linux怎么设置文件夹的权限管理,Linux怎么设置文件文件夹的权限chmod命令

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值