Copy Rename Files in Linux with cp Command

To copy and rename a file on a Linux system, you can use the cp command. The specific command format is:

cp 源文件路径 目标文件路径

For example, to copy and rename the file file1.txt to file2.txt, you can execute the following command:

cp file1.txt file2.txt

This will copy the file1.txt file in the current directory and rename it as file2.txt.

bannerAds