Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how can i find the number of executable files in a folder/directory and display them on the terminal
this is my code below i do not know why its not working
Code:
#!/bin/bash
To=/home/elgin19/d2
cd "To"
find .type f -name "*.sh" | ls -l | wc -l
If you look at the manual page for find, the EXAMPLES section has a number of sample uses of -perm (you can search in the manual page by entering /perm to find the first, then n to find the next and so on).
If you use the more-or-less standard default (022), an executable file will be mode 755, so you might use
Code:
find . -type f -perm 755
to get a list of all executable files; see the manual page for others.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.