Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

ls typically displays only the files and folders in the present directory. But once you add a wildcard it starts searching in sub-directories.


$ ls
fight_folder    file1       file2

$ ls f*
file1   file2


How do you limit the scope to only the current directory?
Using OS X

share|improve this question
up vote 9 down vote accepted

ls -d suppresses listing the contents of directories listed on the command line (via the wildcard). From the documentation:

-d Directories are listed as plain files (not searched recursively).

share|improve this answer

Your Answer


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.