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.

posted @ 2020-05-15 08:54  Jasper2003  阅读(110)  评论(0编辑  收藏  举报