Searching for files
Now that you've had a crash course on how to create and manage files, you probably have quite a few files all over the hard disk that you've created. However, what do you do when you want to update a file, but you've forgotten where it is? The find
command comes to your rescue.
The find
command will allow you to search your filesystem for files based on the search criteria. To use it, you type find
, a path to start the search from, the search criteria, and then the name of the file. For example, consider the following command line:
find / -name myfile
In the preceding example, we chose to start our search in /
(the beginning of the filesystem). We are searching for a specific name (-name
), and the name we're looking for is myfile
. After executing the command, a search will be conducted for the file, and the output returned is the full path of the file once (and if) it's found.
However, you are more likely to see one or more errors when executing the preceding command. As...