在
Linux下,如何找到特定用户可写(或实际上不可写)的所有文件和目录?
编辑:澄清一下,我的意思是在一个特定的子目录下,而不是系统范围内.是的,这意味着允许该用户编写的用户,组和世界可写性的所有排列和组合.我知道这个问题在语义上有什么意义,我希望执行一个或几个行程来获取这些文件的列表.
解决方法
如果您安装了findutils版本4.3.0或更高版本,请使用’find’命令:
find . -writable
find . ! -writable
根据手册页:
This test makes use of the access(2) system call,and so can be fooled by NFS servers which do UID mapping (or root-squashing),since many systems implement access(2) in the client’s kernel and so cannot make use of the UID mapping information held on the server.