The Search for Files application enables you to search for files on your system. To perform a basic search, you can type a filename or a partial filename, with or without wildcards. To refine your search, you can apply additional search options.
Search for Files uses the find, grep, and locate UNIX commands. By default, when performing a basic search Search for Files first uses the locate command, and then uses the slower but more thorough find command.
The case sensitivity of the search depends on your operating system. For example, on Linux, the find, grep, and locate commands support the -i option, so all searches are case-insensitive.
You can start Search for Files in the following ways:
Choose Places ▸ Search for Files...
Choose Search for Files...
Execute the following command: gnome-search-tool
When you start Search for Files, the following window is displayed.
To perform a basic search for a file on the system, perform the following steps:
Enter the search text in the Name contains field. The search text can be a filename or partial filename, with or without wildcards, as shown in the following table:
| Search Text | Example | Result |
|---|---|---|
| Full or partial filename | myfile.txt | Search for Files searches for all files that contain the text myfile.txt in the filename. |
| Partial filename combined with wildcards (*, [, ]) | *.[ch] | Search for Files searches for all files that have extension .c or .h. |
In the Look in folder field, select the folder or device from which you want Search for Files to begin the search.
Click Find to perform the search.
Search for Files searches in the directory that you specify and the subdirectories of the directory. Search for Files displays the results of the search in the Search results list box. If Search for Files does not find any files that match the search criteria, the application displays the message "No files found" in the Search results list box.
By default, Search for Files will perform a quick search using the locate command followed by a more thorough second search using the find command. The locate command is faster because it uses a database of information about files. If this database is more than a week old, Search for Files could warn you that the search results may be out of date and give you the option of disabling the quick search. To update the database, run the command updatedb as the root user.
You can add additional options to search for a file on the system. To add search options, perform the following steps:
To remove a search option from the current search, click on the Remove button next to the option.
To disable the search options from the current search, click on the Select more options text.
| Option Name | Description |
|---|---|
| Contains the text | Search for a file by filename. Enter a full filename or a partial filename with wildcards in the field provided. Use * to indicate a sequence of characters. Use ? to indicate a single character. The search is case sensitive. |
| Date modified less than | Search for files that are modified less than the period specified in days. |
| Date modified more than | Search for files that are modified longer than the period specified in days. |
| Size at least | Search for files that are equal to or larger than the size specified in kilobytes. |
| Size at most | Search for files that are smaller than or equal to the size specified in kilobytes. |
| File is empty | Search for empty files. |
| Owned by user | Search for files that are owned by the user specified. Type the name of the user in the text box provided. |
| Owned by group | Search for files that are owned by the group specified. Type the name of the group in the text box provided. |
| Owner is unrecognized | Search for files that are owned by a user or group that is unknown to the system. |
| Name does not contain | Search for filenames that do not contain the string that you enter. Enter a full filename or a partial filename with wildcards in the field provided. Use * to indicate a sequence of characters. Use ? to indicate a single character. The search is case sensitive. |
| Name matches regular expression | Search for files that contain the specified regular expression in their directory path or filename. Type the regular expression in the text box provided. |
| Show hidden and backup files | Include hidden and backup files in the search. |
| Follow symbolic links | Follow symbolic links when searching for files. |
| Include other filesystems | Search in directories that are not in the same filesystem as the start directory. |
To open a file displayed in the Search results list box, perform one of the following steps:
To open the folder that contains a file displayed in the Search results list box, right-click on the file, then choose Open Folder.
Search for Files provides gconf keys to modify some of its behavior. The gconf values can be changed by starting the Configuration Editor in the following ways:
Choose System Tools ▸ Configuration Editor.
Execute the following command: gconf-editor
Key name: /apps/gnome-search-tool/disable_quick_search
Default value: false
Search for Files speeds up file name searches by using the locate command. Locate provides a secure way to index and quickly search for file names. Because locate relies on a file index, the Search results list may not always be up to date.
Key name: /apps/gnome-search-tool/disable_quick_search_second_scan
Default value: false
After completing a quick search, Search for Files will perform a thorough search using the find command. The purpose of this second scan is to find files that have not been indexed. Files that match the search criteria are added to the Search results list keeping the list up to date.
Key name: /apps/gnome-search-tool/quick_search_excluded_paths
Default values: [/mnt/*,/media/*,/dev/*,/tmp/*,/proc/*,/var/*]
Search for Files will not perform a quick search for paths defined by this key. File name searches in the defined paths will use the find command. The wildcards '*' and '?' are supported.
Key name: /apps/gnome-search-tool/quick_search_second_scan_excluded_paths
Default values: [/]
Search for Files will not perform a second scan after a quick search for the paths defined by this key. Quick searches in the defined paths will not be followed by a thorough search using the find command. The wildcards '*' and '?' are supported.