Ben Asked: 2011-05-03 11:21:14 +0800 CST2011-05-03 11:21:14 +0800 CST 2011-05-03 11:21:14 +0800 CST List non-writable files in Linux 772 How can I get a list of non-writable files within my current directory? linux 4 Answers Voted Best Answer MikeyB 2011-05-03T11:28:03+08:002011-05-03T11:28:03+08:00 Interpreting that as: user/group/other cannot write find . -maxdepth 1 -not -perm /ugo+w coredump 2011-05-03T11:28:01+08:002011-05-03T11:28:01+08:00 This find will find files that aren't writable by anyone: find . ! -perm /222 EDIT: From hmont's suggestion on the comment: find . ! -perm /222 -exec ls -l {} + And as Mikey puts on his answer, you can use -maxdepth 1 to limit the find to a single directory. Aaron Copley 2011-05-03T11:27:27+08:002011-05-03T11:27:27+08:00 find . ! -perm /a+w find . ! -perm -ug+w or some other permutation with symbolic notation to meet your requirements. To clarify, the '/' will match any user, group, or other. To match all, precede the mode with '-'. user13185 2011-05-03T11:27:50+08:002011-05-03T11:27:50+08:00 perl -le 'print for grep { ! -w } <*>'
Interpreting that as: user/group/other cannot write
find . -maxdepth 1 -not -perm /ugo+w
This
find
will find files that aren't writable by anyone:EDIT: From hmont's suggestion on the comment:
And as Mikey puts on his answer, you can use
-maxdepth 1
to limit the find to a single directory.find . ! -perm /a+w
find . ! -perm -ug+w
or some other permutation with symbolic notation to meet your requirements.
To clarify, the '/' will match any user, group, or other. To match all, precede the mode with '-'.