Home » Questions » Computers [ Ask a new question ]

How to get a linux directory listing for files beginning with a certain letter that doesn't descend into subdirectories?

How to get a linux directory listing for files beginning with a certain letter that doesn't descend into subdirectories?

Suppose you are in a directory that contains many files and many subdirectories.

Asked by: Guest | Views: 55
Total answers/comments: 2
Guest [Entry]

"Ah, I just found it on the 6th reading of the man page. It's the not-so-sensibly named ""directory"" parameter

ls -d d*"
Guest [Entry]

"find . -maxdepth 1 -name d* -type f

Okay, using find here is a tad of overkill. Just a tad."