![]() ![]() To demonstrate this we can again search the home directory for Ogg Vorbis files but this time looking for those that are 100 megabytes or larger: This highlights an important difference in the way that find operates in that it examines the system directly each time unlike programs like locate or slocate which actually examine a regularly updated database of filnames and locations.Īnother possible search is to search for files by size. This could be a slow search depending on the number of directories, sub-directories and files on your system. To perform the same search on your entire drive you would run: Here the option '-iname' performs a case-insensitive search while the wildcard character '*' matches any character, or number of characters, or zero characters. For example if you wished to search for all of the ogg files in your home directory, some of which you think might be named 'OGG' rather than 'ogg', you would run: Such a search can be much more sophisticated though. It is important to get into the habit of quoting patterns in your search as seen above or your search results can be a little unpredictable. The following command searches the home directory and all of its subdirectories looking for the file mysong.ogg: The most common use of find is in the search for a specific file by use of its name. These options can involve a search by name, by size, by access time or can also involve actions taken upon these files. The option refers to one or a series of options which effect the overall option of the find command. The option refers to the particular location that you wish to search, whether it be your $HOME directory, a particular directory such as /usr, your present working directory which can simply be expressed as '.' or your entire computer which can be expressed as '/'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |