文件管理命令详解

1、cp
    cp -r:copy文件夹
    cp -p:保留原权限
    cp -a:保留文件/目录/权限,万能选项
    cp abc.txt def.txt fgh.txt backup:copy多个文件的时候,最后一个参数一定为目录。

[root@server130 16:59:31 ~/test]#echo "拷贝文件测试"
拷贝文件测试
[root@server130 16:59:31 ~/test]# umask
0022
[root@server130 16:59:40 ~/test]# ll
total 4
-rw-r--r--. 1 root root 98 Sep 16 16:56 111
[root@server130 16:59:43 ~/test]# chmod 7777 111 
[root@server130 16:59:56 ~/test]# ll
total 4
-rwsrwsrwt. 1 root root 98 Sep 16 16:56 111
[root@server130 16:59:57 ~/test]# cp 111 222
[root@server130 17:00:08 ~/test]# ll            #可见,cp不带参数copy之后,会丢失文件的特殊权限以及会依据umask减去相应的权限。
total 8
-rwsrwsrwt. 1 root root 98 Sep 16 16:56 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值