UNIX - Copying a File

To make a duplicate copy of a file, use the command cp. For example, to create an exact copy of the file called firstfile, you would type:

cp firstfile secondfile

This results in two files with different names, each containing the same information. The cp command works by overwriting information. If you create a different file called thirdfile and then type the following command:

cp thirdfile firstfile

you will find that the original contents of firstfile are gone, replaced by the contents of thirdfile.

猜你喜欢

转载自www.cnblogs.com/JasperZhao/p/12892827.html