linux下wxr的权限,Linux目录权限下操作总结

进入目录需要哪些权限?

[iboy@localhost code]$ ll

total 12

drwxrwxr-x. 2 iboy iboy 4096 Jun 19 21:19 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

[iboy@localhost class-2]$ cd ..

[iboy@localhost code]$ chmod 075 class-2

[iboy@localhost code]$ ll

total 12

d---rwxr-x. 2 iboy iboy 4096 Jun 19 21:19 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

bash: cd: class-2: Permission denied

[iboy@localhost code]$ chmod 175 class-2

[iboy@localhost code]$ ll

total 12

d--xrwxr-x. 2 iboy iboy 4096 Jun 19 21:19 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

[iboy@localhost class-2]$ cd ..

[iboy@localhost code]$ chmod 275

chmod: missing operand after `275'

Try `chmod --help' for more information.

[iboy@localhost code]$ chmod 275 class-2

[iboy@localhost code]$ ll

total 12

d-w-rwxr-x. 2 iboy iboy 4096 Jun 19 21:19 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

bash: cd: class-2: Permission denied

[iboy@localhost code]$ chmod 475 class-2

[iboy@localhost code]$ ll

total 12

dr--rwxr-x. 2 iboy iboy 4096 Jun 19 21:19 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

bash: cd: class-2: Permission denied

一开始目录class-2的权限可读可写可执行,然后将该目录权限改为没有任何权限和可读,可写权限下,均不能进入目录。只有当目录权限为可执行时才能进入目录。

2.对文件改动需要哪些权限?

[iboy@localhost code]$ ll

total 12

d--xrwxr-x. 2 iboy iboy 4096 Aug 6 11:10 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

[iboy@localhost class-2]$ ls

ls: cannot open directory .: Permission denied

[iboy@localhost class-2]$ touch test

touch: cannot touch `test': Permission denied

[iboy@localhost class-2]$ rm file

rm: cannot remove `file': Permission denied

[iboy@localhost class-2]$ mv file test

mv: cannot move `file' to `test': Permission denied

当该目录class-2只有可执行权限时,只能进入该目录,但不能执行任何对文件的操作。

[iboy@localhost code]$ chmod 375 class-2

[iboy@localhost code]$ ll

total 12

d-wxrwxr-x. 2 iboy iboy 4096 Aug 6 11:10 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

[iboy@localhost class-2]$ ls

ls: cannot open directory .: Permission denied

[iboy@localhost class-2]$ touch test

[iboy@localhost class-2]$ rm test

[iboy@localhost class-2]$ mv file test

当目录权限为可写和可执行权限时可以在该目录下进行文件的修改,创建和删除,但不能查看该目录下的文件。

[iboy@localhost code]$ chmod 775 class-2

[iboy@localhost code]$ ll

total 12

drwxrwxr-x. 2 iboy iboy 4096 Aug 6 11:23 class-2

drwxrwxr-x. 5 iboy iboy 4096 Jul 4 21:34 class-3

drwxrwxr-x. 2 iboy iboy 4096 Jul 11 20:34 class-4

[iboy@localhost code]$ cd class-2

[iboy@localhost class-2]$ ls

file file.zip name

当目录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值