Timeline for How can I find only the executable files under a certain directory in Linux?
Current License: CC BY-SA 4.0
23 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 17, 2023 at 21:13 | comment | added | knittl |
@pmor For GNU find, yes, it defaults to . . On macOS the starting-point is mandatory.
|
|
Apr 17, 2023 at 21:12 | history | edited | knittl | CC BY-SA 4.0 |
deleted 4 characters in body
|
Apr 17, 2023 at 11:51 | comment | added | pmor |
It seems that if the <dir> is not present, then the directory is . by default. Is that correct?
|
|
May 4, 2019 at 19:35 | review | Suggested edits | |||
May 4, 2019 at 21:59 | |||||
May 4, 2019 at 19:08 | comment | added | Dan Bolser | I can't edit it. I've been using find for years, but -executeable and -not are both new to me (just saying ;-) | |
May 3, 2019 at 16:25 | comment | added | knittl |
@DanBolser the discussion probably takes longer than actually updating the answer, but I think the answer is complete as it stands now. The OP was specfically about finding files which are executable, not about excluding them. I expect people to read the find man page to some extent and they will find the basic -not operator there.
|
|
May 3, 2019 at 16:13 | comment | added | Dan Bolser | Thanks @knittl, worth editing the answer? | |
May 2, 2019 at 15:08 | comment | added | knittl |
@DanBolser that's as simple as find -not -executable (optionally with -type f , depending on whether you want to only include files in the result)
|
|
May 2, 2019 at 14:54 | comment | added | Dan Bolser | How about not executable? Seems like a good thing to add here... | |
Dec 8, 2014 at 14:03 | history | edited | slhck | CC BY-SA 3.0 |
deleted 95 characters in body
|
May 17, 2013 at 20:57 | comment | added | SSH This |
find: invalid predicate -executable' on RHEL
|
|
Oct 26, 2012 at 15:54 | comment | added | Good Person | -executable isn't at all portable and should be avoided | |
May 14, 2010 at 19:06 | comment | added | Ludwig Weinzierl | If you have an old version of find (probably before 4.3.8) which lacks -executable use find . -perm /u=x,g=x,o=x. | |
Sep 23, 2009 at 9:23 | comment | added | knittl | @dave: glad to hear i’m not the only one :) | |
Sep 21, 2009 at 10:39 | comment | added | David Webb | For some reason I always think that "-type x" will work too. I can only imagine it was available on some flavour of Unix I used once. | |
Sep 21, 2009 at 10:29 | history | edited | knittl | CC BY-SA 2.5 |
added 8 characters in body
|
Sep 13, 2009 at 17:34 | history | edited | knittl | CC BY-SA 2.5 |
added 379 characters in body
|
Sep 10, 2009 at 17:17 | comment | added | davr |
Same here, my find doesn't have a -type x either.
|
|
Sep 10, 2009 at 15:51 | comment | added | innaM | What version of find supports that type for -type? man find lists b, c, d, p, f, l, s and D on my system. | |
Sep 10, 2009 at 12:46 | history | migrated | from stackoverflow.com (revisions) | ||
Sep 10, 2009 at 12:09 | comment | added | knittl | a shebang doesn’t mean they’re executable. it tells us only which interpreter to use. and by linux definition “executable files” are files with the executable (x) bit set | |
Sep 10, 2009 at 12:04 | comment | added | ennuikiller | This will return files with the execute turned on only. A more thorough analysis would check for a shebang line or whether the file is binary | |
Sep 10, 2009 at 11:59 | history | answered | knittl | CC BY-SA 2.5 |