Perform basic file management Flashcards
How are hidden files named?
Begin with a dot
What shorthand refers to the present directory?
.
What shorthand refers to the parent directory?
..
What wildcard represents a single character in a filename?
?
What wildcard matches any sequence of characters om a filename?
*
What notifies matching any character in a set for wildcards in a filename?
[a-z]
What command will list hidden files and directories?
ls -a
What command will show the file types in a listing?
ls -F –file-type
What command will show files recursively?
ls -R –recursive
What command will copy a file?
cp
What command will move a file?
mv
What command will delete a file?
rm
What command is used to create files and or set the modification / access times?
touch
What utility creates a zipped archive and is based on tape archives?
tar
What utility creates an archive based on Copy-out and Copy-in mode?
cpio
What command will copy partitions?
dd
What command will create a directory?
mkdir
What command will delete a directory?
rmdir
What command changes the owner of a file?
chown
What command changes the group for a file?
chgrp
What is meant by file type code - ?
file
What is meant by file type code d ?
directory
What is meant by file type code p ?
named pipe - two programs use the file to communicate
What is meant by file type code s ?
socket - similar to pipe with networking
What is meant by file type code b ?
block device - hard disk, cd, ram etc
What is meant by file type code c ?
character device - hardware device that has data transfered to and from one byte at a time
What represents the file octal code 7?
rwx
What represents the file octal code 6?
rw-
What represents the file octal code 5
r-x
What represents the file octal code 4
r–
What represents the file octal code 0
What does the SUID (Set user ID) do?
Runs a program for all users with the permissions of the owner.
What does the SGID (Set group ID) do?
Runs a program for all users with the permissions of the owner group.
How is the special bit represented?
s
What does the sticky bit do?
Prevents deletion of files by anyone except the owner.
What does chmod do?
Changes premissions on a file
How are the SUID, SGID and sticky bit set?
Extra digit in front of the permission digits
What is the numeric code for SUID?
4
What is the numeric code for SGID?
2
What is the numeric code for the sticky bit?
1
What is the symbolic mode set code of owner?
u
What is the symbolic mode set code of group?
g
What is the symbolic mode set code of world?
o
What is the symbolic mode set code of all?
a
What is the difference between symbolic mode world (o) and all (a)?
world means all those not owner or group, all means owner, group and world.
What would the command chmod o=rwx do?
Change the permissions for world on the file
Who are the only users who can change a file’s permissions?
Owner and root
What command sets the default permissions for a created file?
umask
What command will change the attribute of a file?
chattr
What are wildcards called when used as part of a search?
globbing
What command could be used to compress a file?
gzip or bzip2
What gzip command is used to uncompress files?
gunzip
What rm, cp or mv option will attempt to move a file even if its not writeable?
-f –force
What rm, cp or mv option will ask for confirmation?
-i –interactive
What cp or mv option will make a backup of any files that would be replaced?
-b –backup
What mkdir option would make the parent directories in this command - mkdir d1/d2/d3
-p
What is the important prerequisite of rmdir?
The directory must be empty for deletion.
What ls command will list all child directories and their contents?
ls -R
What command will delete a directory and its contents?
rm -r -R –recursive
What is another name for file wildcard naming?
globbing
What command will put a current or any timestamp timestamp on a file’s atttibutes?
touch
With file access attributes what is meant by the mtime?
Modification time
With file access attributes what is meant by the atime?
Access time
What command is used to determine the type of file?
file
What does the tar option f do?
Where the tarball should be placed?
What does the tar option v do?
verbose output
What does the tar option c do?
create a tarball
What does the tar option x do?
extract an archive
What does the tar option z do?
use gzip
What does the tar option j do?
use bzip2
What does the cpio copy-out mode do?
Creates an archive
What does the cpio copy-in mode do?
Restores an archive
What does the cpio copy-pass mode do?
Copies files from one location to another
What cpio switches are used for copy-out mode?
-o –create
What cpio switches are used for copy-in mode?
-i –extract
What cpio switches are used for copy-pass mode?
-p –pass-through
With dd what does if stand for?
Input file
With dd what does of stand for?
Output file