How to find writable files
If you are looking for files or their permissions, then the find command has you covered. Let’s have a look how to find files that are writable by a user, group, or others.
Find all writable files
We can use the -perm option to see what files have a specific set of file permissions. To match one of the three selectors (user, group, other), we can use a slash.
find . -perm /222
This command will search in the current directory and any file that is writable, will show up.
Writable files by others
Want to find only the files that are writable by others? Then set the first two selector to zero, so that the matching happens on the ‘other’ only.
find . -perm /002
The alternative notation for this command is:
find . -perm /o=w
This type of notation might be easier to read. Want to combine? Sure!
find . -perm /g=w,o=w