Home>Article>Operation and Maintenance> How to copy files using cp command in linux
In Linux, you can use the cp command to copy files and copy the source file or directory to the specified destination file or directory; it can copy a single source file into a specific file with a specified file name or an existing file. directory; this command supports copying multiple files at the same time.
#The operating environment of this tutorial: centos7 system, thinkpad t480 computer.
cp command format
ls -l //显示当前文件夹下所有文件的信息
copy 1234.txt 2345.txtHere you can see that the two files have the same size but different timestamps
cp -i 1234.txt 3456.txtYou can see when the new When the file name already exists in the current directory, there will be an overwrite confirmation reminder. Enter n to cancel and continue copying.
cp 123.txt test //同目录 cp 1234.txt /home/zinkky/test //不同目录时需要带上路径
cp -r test python
linux tutorial)
The above is the detailed content of How to copy files using cp command in linux. For more information, please follow other related articles on the PHP Chinese website!