Some ways of finding files (or content within files) in Linux.
See
AboutThesePages.
Contents
Notes
Find
Find sounds most familiar, but I am always confused by the syntax.
Example:
find -iname <pattern>
Locate
Locate has the simplest syntax, and is usually the fastest, but depends on a database. If the database does not exist, or is not up-to-date, the search will be unsuccessful. Many distros issue the command to update the database (updatedb) as a cron job. I usually find once a day too often, and change the update frequency to once a week. (I don't know whether there is a way to limit the scope of what is included in the database -- this could make me feel better about more frequent updates. Does updatedb only update the locate (or slocate) database? (slocate is a more secure version of locate, used on many distros, but I think locate is often set up as an alias for slocate -- would someone say "locate is aliased to slocate", or the other way around, "slocate is aliased to locate" -- the second sounds more "appropriate" to me.
Example:
locate <pattern?>
AFAIK, a GUI for find.
Grep
Grep is a tool that searches text rather than specifically for file names. However, by catting a directory to a file, or by piping a directory to grep, you can search for a filename.
Example: This is not correct:
grep <string> | ls
<Currently, no significant content below this line.>
Resources
See
ResourceRecommendations. Feel free to add additional resources to these lists, but please follow the guidelines on
ResourceRecommendations including
ResourceRecommendations#Guidelines_for_Rating_Resources.
Recommended
Recommended for Specific Needs
Recommended by Others
No Recommendation
Not Recommended
Contributors
- () RandyKramer - 23 Jul 2002
- <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>
[[Main.RandyKramer#23 Jul 2002][]]
Page Ratings