Answers for "how to list only files and directories"

1

list only directories

# List directories under the current working directory.
ls -l | grep "^d"

# List directories under the current working directory and 
# include hidden folders
ls -la | grep "^d"
Posted by: Guest on October-09-2020
0

find only list directories

find . -maxdepth 1 -type d -iname "<regex>" -printf '%fn'
Posted by: Guest on July-29-2021

Code answers related to "how to list only files and directories"

Browse Popular Code Answers by Language