14.G: Search with the greps | 14: File Utilities | 14.E: Pipe with | |
A common need is to find a file containing some work of yours when you can't quite remember where in your directory tree you put that file.
If you know the name of the file, you can easily find it with the find command
> find ~ -name area.f -print
Here the first argument ~ (meaning "your home directory") is the name of the directory in which to start the search, -name area.f says to look for a file named area.f, and -print says to print out the results of the search to the standard output (in this case your video screen).
Unix should now inform you that area.f is in
yourhomedirectory/development/prog/area.f
The find command has many options to handle various types of searches. Check the man pages if you have a specialized search.
14.G: Search with greps | 14: File Utilities | 14.E: Pipe with | |