Searching for Files

Using Search for File on the Computer+More Applications+System menu, you can locate files on your computer or on a network share using any number of search criteria.

Figure 2.3. Search for Files Dialog

Search for Files Dialog

Search for Files uses the find, grep and locate UNIX commands. All searches are case insensitive.

You can also open the Search for Files dialog by entering the following command into the Run Application dialog (started with Alt+F2):

gnome-search-tool

Performing a Basic Search

  1. Start Search for Files.

  2. Type the search text in the Name contains field.

    The search text can be a filename or partial filename, with or without wild cards, as shown in the following table:

    Search Text

    Example

    Result

    Full or partial filename

    myfile.txt

    Searches for all files that contain “myfile.txt” in the filename.

    Partial filename combined with wild cards (* [ ])

    *.[ch]

    Searches for all files that have a .c or .h extension.

  3. In the Look in folder field, choose the directory where you want Search for Files to begin the search.

  4. Click Find.

Adding Search Options

Use Select more options to search by file content, dates, owner or file size.

  1. Start Search for Files.

  2. Type the search text in the Name contains field.

  3. In the Look in folder field, type the path to the directory where you want Search for Files to begin the search.

  4. Click Select more options, then click Available options

  5. Select a search option that you want to apply, then click Add.

    The following options are available:

    Option

    Description

    Contains the text

    Searches for a file by filename. Type a full filename or a partial filename with wild cards in the field provided. Use an asterisk (*) to indicate a sequence of characters. Use a question mark (?) to indicate a single character. The search is case sensitive.

    Date modified less than

    Searches for files that were modified within the period specified (in days).

    Date modified more than

    Searches for files that were modified before the period specified (in days).

    Size at least

    Searches for files that are equal to or larger than the size specified (in kilobytes).

    Size at most

    Searches for files that are smaller than or equal to the size specified (in kilobytes).

    File is empty

    Searches for empty files.

    Owned by user

    Searches for files that are owned by the user specified. Type the name of the user in the text box provided.

    Owned by group

    Searches for files that are owned by the group specified. Type the name of the group in the text box provided.

    Owner is unrecognized

    Searches for files that are owned by a user or group that is unknown to the system.

    Name does not contain

    Searches for filenames that do not contain the string that you enter. Enter a full filename or a partial filename with wild cards in the field provided. Use an asterisk (*) to indicate a sequence of characters. Use a question mark (?) to indicate a single character. The search is case sensitive.

    Name matches regular expression

    Searches for files that contain the specified regular expression in their directory path or filename. Type the regular expression in the text box provided.

    Regular expressions are special text strings used to describe a search pattern. For more information, see http://www.regular-expressions.info.

    Show hidden and backup files

    Includes hidden and backup files in the search.

    Follow symbolic links

    Follows symbolic links when searching for files.

    Exclude other filesystems

    Searches only in directories that are on the same file system as the start directory.

  6. Specify the required search information for the search option.

  7. To remove a search option from the current search, click the Remove button next to the option.

  8. Click Find.

Using the Search Results List

You can use the Search Results list to open or delete a file found during a search, or you can save the search results to a file.

Figure 2.4. Search Results List

Search Results List

To open a file displayed in the Search Results list, right-click the file, then click Open or double-click the file. To open the folder that contains a file displayed in the Search Results list, right-click the file and click Open Folder.

To delete a file displayed in the Search Results list, right-click the file and click Move to Trash.

To save the results of the last search that Search for Files performed, right-click anywhere in the Search results list and click Save Results As. Type a name for the file that will contain your Search results and click Save.

Disabling Quick Searches

By default, Search for Files tries to speed up some searches by using the locate command. locate provides a secure way to index and quickly search for files. Because locate relies on a file index, the Search Results list might not be up to date. To disable quick searches, run the following command in a terminal window:

# gconftool-2 --type=bool --set /apps/gnome-search-tool/disable_quick_search 1