check all directories linux code example
Example 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"
Example 2: linux commad to show directories
// it will show all directories or folders not files...
ls -d */
Example 3: list all files in a directory and subdirectory linux
find . -type f -follow -print