Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write a permission fix script that uses find to fix permissions on files.

Mainly what I need is a find command that is able to list all files with execute bit set, regardless of the other permissions on the file (that's the trick).

share|improve this question

migrated from serverfault.com Jul 22 '13 at 2:34

This question came from our site for system and network administrators.

What have you already tried? What research have you done? As written right now, you're just asking us to do your work for you, and you haven't shown any effort whatsoever in solving this yourself. – EEAA Jul 21 '13 at 14:30
Also, I'd highly recommend reading up on what types of questions are appropriate here before posting any more questions. You have quite a string of closed and down voted questions, and if not careful, you will likely run afoul of the automatic question ban. – EEAA Jul 21 '13 at 14:40
@EEAA: Sadly, I doubt that's anywhere near close to happening. If you have any rep at all it's really hard to get q-banned. – Iain Jul 21 '13 at 14:46
@Iain - fair enough. Hopefully he'll still heed the advice, though. – EEAA Jul 21 '13 at 14:47
@EEAA: I hope so too but people who can't be bothered to read manuals generally don't heed advice - they just find it easier to whinge about our attitude ... iyswim ;) – Iain Jul 21 '13 at 14:50

On GNU's find:

find /dir -type f -executable

On other versions, see the man page around -perm.

share|improve this answer

Believe it or not this is extensively documented in the find man page. On the CentOS and Ubuntu systems I have to hand there are even examples of this.

-perm /mode

Any of the permission bits mode are set for the file. Symbolic modes are accepted in this form. You must specify u',g' or `o' if you use a symbolic mode. See the EXAMPLES section for some illustrative examples. If no permission bits in mode are set, this test matches any file (the idea here is to be consistent with the behaviour of -perm -000).


find  . -perm /u+x

will find files where execute permission is set for the owner

find . -perm /u+x,o+x

will find files where execute permission is set for the owner and other and so on.

share|improve this answer

find /path/of/the/directory -type f -executable

share|improve this answer
@Could you please explain how that would work? – vfbsilva Jan 30 '15 at 20:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.