Difference between revisions of "Cp"
From Knoppix Documentation Wiki
(Added cp) |
(No difference)
|
Revision as of 00:50, 24 September 2005
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.