• Uncategorized

About linux : How-can-I-find-all-non-executable-files-in-a-directory-in-Linux

Question Detail

What option should be used in find command in Linux for listing non executable file in directory?

Question Answer

Depends on your definition of executable, in this context.

If you mean files that you (current user) are allowed to execute, then you can use something like this (finds non-executable regular files; no directories)

find . -type f ! -executable

If instead, you mean files which have the +x permission set (for their owner or group or everyone), then i believe you want something like this (finds regular files; no directories; which do not have u+x, g+x nor o+x)

find . -type f ! -perm /0111

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.