The grep command can be used to search the output of another command by using the | pipe operator. While that is handy, it might list out thousands of files, so our next step is to search the results for the file name we are looking for. The find command will be installed by default on your Mac, and just about every linux distribution.
You can also give it a path, so if you want to search just your home directory (and it is not your current working directory) you can just run: find ~Īnd that will list every single file in your home directory (The ~ is a shortcut for home directory). The find command is really handy because it will list every file in the current directory and all sub directories. Have you ever had to find a file by a file name or file extension? Sure you have! Here's how I locate a file when I'm using a Mac or Linux shell.