Answers for "list only folders in linux"

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
4

get list of directories bash

for d in */ ; do
    echo "$d"
done
Posted by: Guest on April-16-2020

Browse Popular Code Answers by Language