Difference between revisions of "Cp"


From Knoppix Documentation Wiki
Jump to: navigation, search
(Added cp)
 
m (Reverted edits by 202.154.255.5 (Talk); changed back to last version by Dr Kludge)
 
(One intermediate revision by one other user not shown)
(No difference)

Latest revision as of 05:39, 15 July 2008

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.