[root@Freedom1991 test1]# cp /root/test/file test1 复制文件到
[root@Freedom1991 test1]# ls
file.ln test1
[root@Freedom1991 ~]# cp -ax test test1 复制所有的目录及包含的目录
[root@Freedom1991 ~]# ls
anaconda-ks.cfg install.log install.log.syslog linux test test1 公共的 模板 视频 图片 文档 下载 音乐 桌面
[root@Freedom1991 ~]# mv test/file test1/lover 将文件移动并重命名
[root@Freedom1991 ~]#
文件权限: 四种
读 r 4
写 w 2
执行 x 1
无 0
chmod修改文件权限:
drwxr-xr-x 2 root root 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chmod -R 777 /linux
[root@Freedom1991 /]# ls -l
drwxrwxrwx 2 root root 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chmod -R 000 /linux
d--------- 2 root root 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chmod -R u+w,g+r,o+x /linux
d-w-r----x 2 root root 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chmod -R u+rwx,g-w,o-x /linux
drwxr----- 2 root root 4096 9月 30 13:57 linux
如果文件中还有其他子目录要使用 -R
chown 改变文件所者
drwxr----- 2 root root 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chown root.dn123456 /linux
drwxr----- 2 root dn123456 4096 9月 30 13:57 linux
[root@Freedom1991 /]# chown dn123456.dn123456 /linux
drwxr----- 2 dn123456 dn123456 4096 9月 30 13:57 linux
转载于:https://blog.51cto.com/freedom1991/1699537
本文详细介绍了Linux环境下文件的复制、移动、重命名、权限修改等基本操作,并通过实例展示了如何使用命令行实现这些功能。同时,还介绍了如何通过`chown`命令改变文件所有者,以及如何使用`chmod`命令调整文件权限,确保数据的安全性和可访问性。

被折叠的 条评论
为什么被折叠?



