Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 12162  / 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
hreadsoplet questions
Fri, Nov 11, 22, 14:00, 2 Years ago
Wed, May 25, 22, 18:11, 2 Years ago
Thu, Jan 20, 22, 09:26, 2 Years ago
;