>_ IzzyLab

Topic breakdown

Hunting for a file by hand with cd and ls takes forever when there are dozens of directories. find does it for you: it starts from the directory you give it, goes into every nested one and prints each path that matches the conditions.

find /etc -name hostname      # every file and directory named hostname inside /etc
find /etc -name '*.conf'      # every name ending in .conf — put the pattern in quotes

-name compares the whole name: -name host won't find hostname.

What's checked

  1. File /root/path.txt created
  2. path.txt holds the full path to the right invoice

What it looks like