cp 选项 [原文件或目录][目标目录]
英文原意:copy
-r 复制目录
-p 连带文件属性复制
-d 若原文件是连接文件则复制连接属性
-a 相当于-pdr
例如:
[email protected]:~$ ls aaa japan [email protected]:~$ cp aaa /tmp/bbb [email protected]:~$ ls /tmp bbb systemd-private-389178f43f8842f1b14b9b1c5243610d-systemd-timesyncd.service-V1LZmU [email protected]:~$ cp japan /tmp cp: omitting directory ‘japan’ [email protected]:~$ cp -r japan /tmp [email protected]:~$ ls /tmp bbb japan systemd-private-389178f43f8842f1b14b9b1c5243610d-systemd-timesyncd.service-V1LZmU [email protected]:~$ [email protected]:~$ ll aaa -rw-rw-r-- 1 xiaolu xiaolu 0 Aug 19 00:45 aaa [email protected]:~$ ll /tmp/bbb -rw-rw-r-- 1 xiaolu xiaolu 0 Aug 19 00:46 /tmp/bbb [email protected]:~$ cp -a aaa /tmp/ccc [email protected]:~$ ll /tmp/ccc -rw-rw-r-- 1 xiaolu xiaolu 0 Aug 19 00:45 /tmp/ccc [email protected]:~$
时间: 2024-10-14 00:15:11