打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux怎么设置文件文件夹的权限chmod命令
userphoto

2018.04.12

关注

NAME
       chmod - 改变文件的访问权限

总揽
       chmod [options] mode file...

POSIX 选项:
       [-R]

       GNU  选项  (最短方式): [-cfvR] [--reference=rfile] [--help] [--version]
       [--]

描述
       使用chmod命令改变指定文件访问权限有两种方式:一种是用符号
       标记所进行更改,另一种方式是采用8进制数指定新的访问权限。


​POSIX 选项
       -R 改变目录及目录下的内容的访问权限.

GNU 选项
       -c, --changes
              只有在文件的权限确实改变时才进行详细的说明

       -f, --silent, --quiet
              不输出权限不能改变的文件的错误信息

       -v, --verbose
              详细说明权限的变化

       -R, --recursive
              改变目录及其所有子目录的文件的权限


tarena@ubuntu:~/uc/day07$ chmod -R a-x aaa
tarena@ubuntu:~/uc/day07$ cd aaa
bash: cd: aaa: 权限不够

tarena@ubuntu:~/uc/day07$ chmod -R a-x aaa
chmod: 无法读取目录"aaa": 权限不够
tarena@ubuntu:~/uc/day07$ ls -l
总用量 16
d-w--w---- 2 tarena tarena 4096  4月 12 22:02 aaa
-rw-rw-r-- 1 tarena tarena   26  4月 11 13:13 day07.txt
-rw-rw-r-- 1 tarena tarena    8  4月 11 13:55 hello2.c
-rw-rw-r-- 1 tarena tarena    8  4月 11 13:24 hello.c
tarena@ubuntu:~/uc/day07$


tarena@ubuntu:~/uc/day07$ chmod -R a+x aaa
chmod: 无法读取目录"aaa": 权限不够
tarena@ubuntu:~/uc/day07$ cd aaa
tarena@ubuntu:~/uc/day07/aaa$

tarena@ubuntu:~/uc/day07$ ls -l
总用量 16
d-wx-wx--x 2 tarena tarena 4096  4月 12 22:02 aaa
-rw-rw-r-- 1 tarena tarena   26  4月 11 13:13 day07.txt
-rw-rw-r-- 1 tarena tarena    8  4月 11 13:55 hello2.c
-rw-rw-r-- 1 tarena tarena    8  4月 11 13:24 hello.c


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Linux文件夹执行权限不够如何处理?
Hadoop学习常用的Linux命令 | 吴超沉思录
linux中关于权限的一些事
LINUX命令大全
关于Linux下的umask
Linux修改文件及文件夹权限
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服