Find Files

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 othrif othrif    0 Jul 29 21:21 data_science.csv,
drwxrwxr-x 2 othrif othrif 4096 Jul 29 21:21 marketing
-rw-rw-r-- 1 othrif othrif    0 Jul 29 21:21 marketing.txt,
-rw-rw-r-- 1 othrif othrif    0 Jul 29 21:21 product.html
drwxrwxr-x 2 othrif othrif 4096 Jul 29 21:21 sales
-rw-rw-r-- 1 othrif othrif    0 Jul 29 21:21 sales.txt,

Find All Files In A Given File Path

-type f indicates we want to find only files.

find ~/example_directory -type f
/home/othrif/example_directory/data_science.csv,
/home/othrif/example_directory/product.html
/home/othrif/example_directory/sales.txt,
/home/othrif/example_directory/marketing.txt,

Only list dirrectories

ls -d path/to/folders/*/

Find directories ignoring Permission denied

find / -type d -name NAMEofDirectory 2>/dev/null