Linux 3 - File Systems
Terms
undefined, object
copy deck
- This option with the cp command backs up the destination file before overwriting it.
- -b
- What character is used in a filename to specify a backup file
- ~
- Using cp or mv with this option prompts for verify before overwriting a file.
- -i
- Use this option with CP or mv to force over write of existing file
- -f
- To preserve file attributes with cp & copy the directory hierarchy as well use this option?
- -P
- which switch is used with the mv or rm command to prompt before overwriting destination file?
- -i
- This switch used with the mv command causes the name of each file to be displayed before it is moved.
- -v
- The mkdir can create the parent and child directories in a single command by using this option?
- -p
- The default permissions for the new directory allow the owner, the owner's group, and all other users what permission? (represented by octal # 777)
- read, write and execute
- The default permissions of mkdir can be changed by using this option?
- -m
- To delete a directory using rm, use this option? To delete without individual confirmat use this option?
- -r, -fr
- Using this option lets you remove entire directory hierarchies that consist only of empty directories.
- -p
- Using this option with CP will force an overwrite of existing files.
- -f
- To recursively copy one directory's contents to another, use either of these options?
- -r or -R
- You want to overwrite June report with the July report. What command would you use to accomplish this task?
- cp -f July June
- What option deletes all the files in the directory and then deletes the directory itself?
- -r,
- What option recursively deletes files and directories without confirmation?
- -fr
- Unlike "rm -r", using this command can only remove empty directories?
- rmdir
- With rmdir you can remove all empty directories in a directory hierarchy using this option?
- -p
- You want to delete the directory June/reports only if it is completely empty. If removing June/reports leaves the June directory empty, you want to delete June as well
- rmdir -p June/reports
- This pattern character expression is used to match special characters?
- \x
- This pattern expression matches to the beginning of a line?
- ^pattern
- This pattern expression matches to the end of a line?
- pattern$
- This command searches a file contents for a pattern or simple string.
- global regular expression print (grep)
- With grep, this option shows the line numbers of each line containing the search string.
- -n
- With grep, if you only want to know the # of lines containing the pattern, use this option?
- -c
- Using grep, if you want to see lines that do not contain a certain word or phrase, use this option?
- -v
- To have grep use a file to list the files that need to be searched for a word or phrase, use this option?
- -f
- When using a file list, grep's default action is to list the name of each file as a header before listing the results. This behavior can be suppressed by using this option.
- -h
- Use this option for grep to be case insensitive?
- -i
- If you want grep to find only occurrences where the pattern is a word unto itself, use this option?
- -w
- To have grep can find the names of files containing an expression without displaying the lines where the expression occurs use this option?
- -l
- to have grep supress error messages on files it can't read, use this option?
- -s
- How would you find every occurrence of the word dog (regardless of case) in a file called pets?
- grep -iw dog pets