How to list directories names but not their contents, in *N*X?
If I do a simple ls specifying a filename pattern, like ls A*, for directories that match the pattern, it will enter the directory and give the full listing, but how could I get just the listing for ./ and only the names of the directories inside, but not their contents?
3 Answers
You can try this command:
ls -d A*/ 1 If you need to do it recursively you could use
find . -type d -name A\* ls -l | grep '^d' will list only directories in the '.' current directory