博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux 改变档案属性与权限
阅读量:4345 次
发布时间:2019-06-07

本文共 2564 字,大约阅读时间需要 8 分钟。

改变所属群组 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

  

 

转载于:https://www.cnblogs.com/Stay-J/p/10872534.html

你可能感兴趣的文章
Sybase IQ导出文件的几种方式
查看>>
linux 系统下 tar 的压缩与解压缩命令
查看>>
阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
查看>>
转:How to force a wordbreaker to be used in Sharepoint Search
查看>>
MySQL存储过程定时任务
查看>>
Python中and(逻辑与)计算法则
查看>>
POJ 3267 The Cow Lexicon(动态规划)
查看>>
设计原理+设计模式
查看>>
tomcat 7服务器跨域问题解决
查看>>
前台实现ajax 需注意的地方
查看>>
Jenkins安装配置
查看>>
个人工作总结05(第二阶段)
查看>>
深入理解Java虚拟机&运行时数据区
查看>>
02-环境搭建
查看>>
spring第二冲刺阶段第七天
查看>>
搜索框键盘抬起事件2
查看>>
阿里百川SDK初始化失败 错误码是203
查看>>
透析Java本质-谁创建了对象,this是什么
查看>>
BFS和DFS的java实现
查看>>
关于jquery中prev()和next()的用法
查看>>