« Back to File systems: Frequently Asked Questions

How to find writable files

How to find files that are writable on Linux?

Run the find command with the -perm option to filter out the relevant entries.

find . -perm /222

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

Learn more about find

This article uses the find command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: find

find cheat sheet

Other questions related to Linux file systems

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon