At this point, we already know about the commands locate, find, and grep (plus regular expressions), but what about if we wanted to create our own naive implementation of a directory crawler/scraper/indexer? It certainly won't be the fastest or have optimizations, but we can use recursive functionality and file tests to print a tree-like structure.
Note
This exercise is a bit of a fun exercise and certainly recreates the proverbial "wheel". This can be easily done by running the tree command, however, this will be useful in an upcoming exercise when we'll be building arrays of arrays for files.
Besides having a terminal open, let's create some test data:
$ mkdir -p parentdir/child_with_kids $ mkdir -p parentdir/second_child_with_kids $ mkdir -p parentdir/child_with_kids/grand_kid/ $ touch parentdir/child.txt parentdir/child_with_kids/child.txt parentdir/child_with_kids/grand_kid/gkid1.txt $ touch parentdir/second_child_with_kids...