list dir only files 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: os list all files in one dir
import glob
print(glob.glob("/home/adam/*.txt"))