Cp


From Knoppix Documentation Wiki
Revision as of 00:50, 24 September 2005 by Dr Kludge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

cp is the Linux copy file command. cp has many options.

cp file1.txt file2.txt

The basic form of the copy command copies one file from one location to another.

cp -p file1.txt file1org

One useful variation of the command is to preserve all the attributes of the source file. In this case, the source files is file1.txt.

cp -rp /home/* /mnt/backup/home

The recursive option can be added to the perserve option. This combination of options is helpful during the recovery of a failed system. knoppix can be used to mount a bad harddrive. You can attempt to use the copy command to copy all the files that are salvagable.