Ubuntu – How to remove a specific folder from the Ubuntu search?


Is there a way to block a specific folder's files from showing up in the Unity search?

Best Answer

  • When you use files and folders, your activity is logged by a service called Zeitgeist. Unity uses the data from Zeitgeist in its search results.

    Because Zeitgeist and Unity are separate services, Zeitgeist shouldn't be affected by updates to Unity.

    As far as I'm aware, the Activity Log Manager is the only easy way to manage what Zeitgeist logs. I know you're worried about the Zeitgeist Activity Log Manager not being 'native', but as far as I can tell, it is. It's maintained by Zeitgeist's developers and is going to be included in Ubuntu Precise; I think the only reason it isn't included in Oneiric is because it was released too late.

    As you might have seen from the OMG Ubuntu article Gonzo linked to, there's a PPA, so keeping Zeitgeist and the Activity Log Manager up to date really isn't anything to worry about. I installed Activity Log Manager on my Oneiric netbook months ago, and it's working perfectly since then.

    Here's what you need to do to:

    sudo add-apt-repository ppa:zeitgeist/ppa 
    sudo apt-get update
    sudo apt-get install activity-log-manager

    You can then launch it by searching for it in Unity. Once it's loaded, you'll find the option to prevent certain folders being logged in the Files tab.

    When you use these files they won't be logged by Zeitgeist any more, but if you've used any of the files before they'll still show up in Unity's search results. To stop this, you'll need to delete Zeitgeist's record of them. The best way to do this would be to use "Activity Journal", which you might need to install first. Just search for it in the Ubuntu Software Centre or run:

    sudo apt-get install gnome-activity-journal

    Fire it up, and you'll see your computer usage is sorted chronologically. Flick through until you find when you last used those files, right click on a file and click "Delete all items with this URL"; Zeitgeist will forget you ever used that file.

    The Activity Journal is included in the default Ubuntu repositories, so if you really don't want to add the PPA and install the Activity Log Manager, you could install it and use it to manually delete Zeitgeist's records each time you use your files. This wouldn't be very convenient, though.

    EDIT: I originally said the the Activity Log Manager was an official GNOME project - as you'll see from Manish's comment, it turns out not to be. I've changed my wording to "maintained by Zeitgeist's developers".