COMP 325 Study Guide - Quiz Guide: Semicolon
1. Do problem 9 (What do the following commands do?) in Chapter 9.
What do the following commands do?
a. cp -f sample sample.bak
Copy ‘file1’ to ‘file2’; if ‘file2’ is a directory, make a copy of ‘file1’ in this
directory
–f
Force copying if there is no write permission on the destination file
b. cp -fp sample sample.bak
Purpose:
Copy ‘file1’ to ‘file2’; if ‘file2’ is a directory, make a copy of ‘file1’ in this
directory
–f
If the destination exists, prompt before overwriting
–p
Preserve file attributes such owner ID, group ID, permissions, and modification
times
c. rm -i ∼/personal/memo*.doc
removes all the files from ∼/personal/memo directory
that begins with memo and extension .doc
Purpose:
Remove files in ‘file-list’ from the file structure (and disk)
Commonly used options/features:
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Do problem 9 (what do the following commands do?) in chapter 9. What do the following commands do: cp -f sample sample. bak. Force copying if there is no write permission on the destination file: cp -fp sample sample. bak. Copy file1" to file2"; if file2" is a directory, make a copy of file1" in this directory. Preserve file attributes such owner id, group id, permissions, and modification times: rm -i /personal/memo*. doc removes all the files from /personal/memo directory that begins with memo and extension . doc. Recursively remove the files in the directory, which is passed as an argument; this removes everything under the directory, so be sure you want to do so before using this option. rm delete ~/linuxbook/final directory beginning with ch followed by any 2 characters and. prn file suffix, -f ignore access rights: rm -f /unixbook/final/*. o removes with . o extension f. rm -f /courses/ece446/lab[1-6].