Chapter 4 - Managing Files Flashcards
A few characters have special meaning and should never be used in filename. There are 5 of them:
4-179
Asterisk Question mark Forward slash Backslash Quotation mark
What is the limit on filename length?
4-179
255 characters (255 bytes)
Talking about dots and directories. If your current directory is /home/jerry, what does “.” And “..” refer to?
4-179
. = /home/jerry (current directory) .. = /home (parent directory)
What is a wildcard?
4-180
Symbol or set of symbols that stands in for other characters
What are the 3 classes of wildcards?
4-180
Question mark – single character
Asterisk – matches any character, set of characters, no character
Bracketed values – these characters match any characters in the set
When you are understanding file commands, there are 5 everyday commands that are CRITICAL. Tell me what they are:
4-180
List Copy Move Rename Delete
Tell me the syntax for the list command
4-180
ls [options] [files]
if you do the ls command as ls –a or ls –all, what will happen?
4-181
You’ll see the configuration files (begin with a .)
If you do the ls command as ls –r or ls –recursive, what will happen?
4-182
You’ll display the target directory’s files AND all of its subdirectories.
Tell me the syntax for the copy command.
4-183
cp [options] source destination
if you do a cp –R, what will happen?
4-184
You’ll copy the directory and all its subdirectories
What is the syntax for the move command?
4-185
mv [options] source destination
what’s the command for deleting a file? What’s the syntax for it?
4-186
rm
rm [options] files
in linux, there are 3 time stamps for every file. Tell me what they are:
4-187
Last file-modification time
Last inode change time
Last access time
What does the “make” utility do?
4-187
Compiles a program from source code
What do you use the “touch” command for?
4-187
Modifying the time stamps
There are several commands you can use for archiving files. Tell me what they are.
4-187
tar
cpio
dd
the tar utility has 7 commands you should know. What are they and what do they do?
4-188
Create – c – creates an archive
Concatenate – A – appends tar files to an archive
Append – r – appends non tar files to an archive
Update – u – appends files that are newer than those in an archive
Diff (or compare) – d – compares an archive to files on disk
List – t – lists an archive’s contents
Extract (or get) – x – extracts files from an archive
What do qualifiers do?
4-188
They modify what commands do.
What are the 6 most useful qualifiers and what do they do?
4-189
g – perform incremental backup p – keep permissions z – use gzip compression j – use bzip2 compression J – use xz compression v – be verbose
there are 3 compression tools used with the tar command. Tell me what they are and whether they apply compression to the archive file or to the individual files of the archive file.
4-189
gzip
bzip2
xz
They apply compression to the whole archive file.
Of the 3 compression tools, which one offers the best compression? What is something that is compressed by it?
4-190
xz
The linux kernel
Tell me the syntax for tar archiving.
4-190
tar [options] destination/tar_file_name files-to-archive
if you use the tar command to archive data, what command do you use to restore data from archive file or media device?
4-191
cpio
the cpio utility has 3 modes. Tell me what they are.
4-191,192
Copy out mode –o, this creates an archive and copies files into it
Copy in mode –i, this extracts data from an existing archive
Copy-pass mode –p, it combines the copy-out and copy-in
There are options for use with cpio. They are listed below, tell me their abbreviations and what they do.
- Reset-access-time
- Append
- Pattern-file=filename
- File=filename
- Format=format
- No-absolute-file-names
- List
- Unconditional
- Verbose
4-192,193
- Resets the access time after reading a file so that it doesn’t appear to have been read
- Appends data to an existing archive
- Uses the contents of filename as a list of files to be extracted in copy-in mode
- Uses filename as the cpio archive file; if this parameter is omitted, cpio uses standard input or output
- Uses a specified format for the archive file (bin, crc, and tar)
- uses the filename specified by filename instead of standard output
- desplays a table of contents for the input
- replaces all files without first asking for verification
- displays filenames as they’re added to or extracted from the archive
What do you have to do in order to use cpio to archive a directory?
4-193
You have to pipe the standard output of the find utility into the cpio command.
In linux, what is a link?
4-195
It is a way to give a file multiple identities.