linux show directory 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: how to filter directory in linux

#directory structure:
    - G10
    - G11
    - G12
    - thisDir
    
#command to enter to filter for all the G?? directories:
	ls -d G??
    
#entering this will return:
    - G10
    - G11
    - G12