Bash递归列出所有对当前用户不可写的文件。

huangapple go评论52阅读模式
英文:

Bash list all files unwritable with the current user recursively

问题

以下是翻译好的部分:

有关如何使用find命令查找所有可写文件的问题都有答案,但我不知道如何反转这个过程,也找不到关于如何查找不可写文件的问题。唯一直接解决这个问题的答案是针对Linux的,而在MacOS上不起作用。因此,可以相对安全地认为这个问题是独一无二的。

英文:

There are questions with answers about how to find all of the writable files with find command, but I do not know how to invert this, and I cannot find questions asking how to find unwritable files. The only answer brought to light directly addressing this is for Linux and does not work on MacOS. Hence, this question can fairly safely be considered unique.

答案1

得分: 3

这将递归地查找当前用户无法写入的所有文件。

英文:

This should find all files unwritable with the current user recursively

find . \! -perm -u=w

huangapple
  • 本文由 发表于 2023年6月12日 15:58:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76454602.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定