How to Hide or Add Specific Folders From Ubuntu/Fedora Search Results

In Ubuntu and Fedora workstation, it allows to search files or folders from the ‘Show Applications‘ or ‘Activities‘ overview.

Since it does not index all the file folders, user may want to add custom folder contents from search result. And, due to privacy, some may want to hide a specific folder. Here, I’m going to show you how!

GNOME Tracker system:

For Ubuntu, Fedora, and other Linux with GNOME Desktop, it uses ‘Tracker‘ system to provide searching and indexing functionality.

With it, user may search for and open applications from either ‘Activities‘ overview or ‘Show Applications‘ screen. Besides that, it shows matching files or folders from ‘Desktop’, ‘Documents’, ‘Music’, ‘Pictures’, ‘Videos’ and their sub-folders. And, it also searches in ‘Home’ and ‘Downloads’ but without sub-directories.

Search Files in GNOME Activities

Add Custom Folder Content to Search Results:

As I mentioned above, user may search common files under user’s Documents, Pictures, Music, Videos directories. However, Gnome desktop does not index other folders under user’s home directory, e.g., user or app created folder, hidden file folders, and sub-directory under Downloads.

To do a custom folder, firstly open ‘Settings‘ either from system tray menu option or by searching in ‘Activities’ overview:

Secondly, go to ‘Search‘ from the left pane and then click on ‘Search Locations‘ on top of the settings window.

In pop-up dialog, you’ll see the options to toggle index common folders and bookmarks if any. Go to ‘Other‘ tab, there you may click ‘+‘ to select custom folder content to search results.

Add Custom Folder to Gnome Activities Search Results

Hide Specific folder from Gnome Activities Search Result:

As the previous step shows, user may control whether to index common folders (e.g., Desktop, Videos, Music, Documents) in ‘Settings -> Search -> Search Locations’. But, what if you want to search ‘Documents‘ but exclude a specific sub-folder.

Method 1: Ignore folders by creating an empty file

By default, the tracker system will ignore folders that contains one of ‘.trackerignore‘, ‘.hg‘, ‘.git‘ or ‘.nomedia‘ files.

Which means, create an empty file under the folder and re-name it to either one of the preview 4 files will make the folder hidden from search results.

NOTE: that a filename start with '.' is hidden file. User needs to press Ctrl+H to toggle display.
Create ‘.trackerignore’ to hide the folder from search results

Don’t find option to create new document? This tutorial may help.

Method 2: Configure ignore folders via Dconf Editor:

Firstly, search for and install the advanced configuration tool ‘Dconf Editor‘ from Ubuntu Software or Gnome Software.

Secondly, open the tool by searching from Gnome Activities overview screen. When it opens, navigate to ‘org/freedesktop/tracker/miner/files‘.

Finally, do:

  • click to go to ‘ignored-directories‘ settings.
  • turn off the slider icon for ‘Use default value’.
  • add the folder name with quotes in the ‘Custom value’.
  • finally click ‘Apply’

In the picture below, I added ‘work’ folder. So, Gnome ‘Activities’ will not search in any folder and its sub-directories named ‘work’.

Ignore ‘work’ folder in anywhere from search results

As you may see, there’s also options to ignore some file extensions. Keep in mind that ignored files / folders take effect immediately, but it needs to log out and back in when you re-enable them.

That’s all. Enjoy!

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.