Search code examples
linuxbashfindls

Linux - finding hidden files that are executable by the owner using ls or find command


Well, as the post title says, I need to find the (only) Hidden files that are executable by the Owner using ls or find command.

I was able to get these.. A command to find all the executable files

find <dir> -executable -type f

And, this one's to find all the hidden files

find . ".*" -ls

So, I was able to find the hidden files and executables but I couldn't filter only the hidden files that are executable by the Owner.


Solution

  • You can try this find,

    find . -name '.*' -type f -perm /700
    

    Explanation:

    -perm /700 - find hidden files which is having executable by the owner.