Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I list all executables (programs) and shell scripts in a directory, sub-directory and/or PATH?

I am not talking about software that was installed with apt-get or any package manager. Using Ubuntu 12.04.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

You can use ls, for example:

ls *.bin *.py

Add any other extensions you wish to list on the command line.

A better way would be to use find, for example:

  1. Do a recursive search from the current directory

    find . -type f -executable
    
  2. Search the current directory

    find . -type f -executable -maxdepth 1
    

Note: The dot after find means search from the current directory. Change it as needed to search from other directories.

share|improve this answer
add comment

If your'e the "creative" type, an ls command can show colorings for executable types as seen here. May not be as useful as filtering, but hey, it looks nice.

share|improve this answer
add comment

Your Answer

 
discard

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.