Next 14.G: Search with the greps Up 14: File Utilities Prev 14.E: Pipe with | Contents


Specialized

§ 14.F: Find Files with find


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

The find command has many options to handle various types of searches. Check the man pages if you have a specialized search.


Next 14.G: Search with greps Up 14: File Utilities Prev 14.E: Pipe with | Contents


Comments and questions to CP-unix@physics.orst.edu.