ls list only directory code example
Example 1: ls -al 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: python ls directory
import os
os.listdir()