semafors

image_pdfimage_print

 

matrix fork using c++

image_pdfimage_print

 

qt paint class

image_pdfimage_print

Search in directories on ubuntu

image_pdfimage_print

Locating Files by Name

The most common use of find is in the search for a specific file by use of its name. The following command searches the home directory and all of its subdirectories looking for the file mysong.ogg:

 

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. Such a search can be much more sophisticated though. 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:

 

Here the option ‘-iname’ performs a case-insensitive search while the wildcard character ‘*’ matches any character, or number of characters, or zero characters. To perform the same search on your entire drive you would run:

 

This could be a slow search depending on the number of directories, sub-directories and files on your system. 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.