Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 12158  / 1 Year ago, thu, march 2, 2023, 2:16:37

I know there is a find switch. but I want to know how to search a specific type of file. For example I need kind of terminal command which search for only executable files.


More From » find

 Answers
5

This should do what you want:



find . -perm -u+x -type f  


If you want to find everything that could possibly be executable, you could look at mime-types or file output. That would be counter-productive though since you couldn't possibly catch every script.



References:

The man page

Stackoverflow


[#26290] Thursday, March 2, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hreadsoplet

Total Points: 220
Total Questions: 108
Total Answers: 105

Location: Serbia
Member since Fri, Jun 3, 2022
2 Years ago
;