Find Directories

Make Files And Directories

touch sales.txt, marketing.txt, data_science.csv, product.html; mkdir sales marketing

View Files And Directories

ls -l
total 8
-rw-rw-r-- 1 chris chris    0 Jul 29 21:21 data_science.csv,
drwxrwxr-x 2 chris chris 4096 Jul 29 21:21 marketing
-rw-rw-r-- 1 chris chris    0 Jul 29 21:21 marketing.txt,
-rw-rw-r-- 1 chris chris    0 Jul 29 21:21 product.html
drwxrwxr-x 2 chris chris 4096 Jul 29 21:21 sales
-rw-rw-r-- 1 chris chris    0 Jul 29 21:21 sales.txt,

Find All Directories In A Given File Path

-type d indicates we want to find only directories.

find ~/example_directory -type d
/home/chris/example_directory
/home/chris/example_directory/sales
/home/chris/example_directory/marketing