NOTE – The following technique works only on Fedora. This is because the location of the recently-used.xbel file varies from one distro to another. Refer this excellent post for an Ubuntu-specific guide
We’ve all had times of indiscretion where we’ve opened files on our computers that we’d rather not have others finding out about *cough*porn*cough*. Or maybe you’re here for genuine privacy issues. Anyway, here’s the lowdown on how you can go about clearing that pesky list of recent documents that pop up in GNOME 3’s search results (I would have added a rant about how this used to be a simple task in GNOME 2, but I’m trying to kick the habit :p)
Fire up a terminal and enter the following commands in order –
"" > ~/.local/share/recently-used.xbel
sudo chattr +i ~/.local/share/recently-used.xbel
While the first command overwrites the existing recently-used.xbel file (in case you haven’t figured it out yet, that’s the file responsible for keeping track of your recently used items) with a blank one, the second command changes the attributes of the file so that it cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute (this info is straight from the man page of chattr).
In order to enable the recent items list again, use the following command –
sudo chattr -i ~/.local/share/recently-used.xbel
You may have to restart GNOME Shell for the changes to take effect.
Credit goes to this thread.