改变所属群组 chgrp
chgrp -R 组名 文件名
[root@ ~]# ll用量 22488drwxr-xr-x 2 root 1111 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz [root@~]# chgrp -R shen demo_test [root@~]# ll 总用量 22488 drwxr-xr-x 2 root shen 4096 5月 15 21:47 demo_test drwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demo drwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_env drwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia -rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz [root@iZj6c1fa4tkhgpvnd9f12rZ ~]# chgrp -R 1111 demo_test
-R 可以把内部文件递归改变group 组别
改变文件拥有者 chown
chown -R 用户名:组名 文件名
[root@~]# chown -R shen demo_test[root@~]# ll总用量 22488drwxr-xr-x 2 shen 1111 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz[root@~]# chown -R qwer:qwer demo_testchown: 无效的用户: "qwer:qwer"[root@~]# chown -R root:root demo_test[root@~]# ll总用量 22488drwxr-xr-x 2 root root 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz
改变文档权限
r ----4
w ----2
x ----1
chmod -R 777 文件名
[root@~]# ll总用量 22488drwxr-xr-x 2 root root 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz[root@~]# chmod -R 000 demo_test[root@~]# ll总用量 22488d--------- 2 root root 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz[root@~]# chmod -R 730 demo_test[root@~]# ll总用量 22488drwx-wx--- 2 root root 4096 5月 15 21:47 demo_testdrwxr-xr-x 2 root root 4096 3月 18 11:32 docker_demodrwxr-xr-x 2 root root 4096 3月 12 10:56 gpu_envdrwxr-xr-x 3 root root 4096 3月 12 15:15 nvidia-rw-r--r-- 1 root root 23010188 12月 24 11:01 Python-3.6.8.tgz