The cp
command is the abbreviation of the English word copy
, and its role is to copy files or directories.
The cp
command can copy multiple files to a specific file name or an existing directory, and can also copy multiple files to a specified directory at the same time.
Syntax format: cp [parameter] [source] [target]
Common parameters:
Example
# 复制文件夹dir1到dir2下cp -R dir1 dir2/ # 复制多个文件到目录dir下cp test1.py test2.py test3.py dir # cp还可实现文件或文件夹重命名的效果cp test1.py test2.py # 针对动态链接库,需要保持原来的软链接关系cp -a libopencv*.so /lib/
This article is reprinted from https://xugaoxiang.com/2022/06/01/linux-cmds-5-cp/
This site is for inclusion only, and the copyright belongs to the original author.