When using gnome-shell there isn’t any way to clear your recent items (yet).
There is a way to do it via CLI.
rm ~/.recently-used.xbel
rm ~/.recently-used
After a few second or opening a random file, your recent items are cleared.
13 Responses to “Clear “Recent Items” in Gnome-Shell”

It does not work for me.
after those commands do
mkdir /home/user/recently-used.xbel
only a temporary workaround but it’s being worked on
Thanks for the add on.
Making this directory should prevent that Ubuntu creates a new list with recent items.
If you download the AWN dock bar, there is an applet called main menu. It opens like the gnome 2 menu. From there you click on recent documents scroll to the bottom and click clear recent items.
Jason’s comment on the “AWN – Cairo Main Menu” works VERY effectively.
Was worried that I wasn’t gonna be able to use the GnomeShell regularly because of the Recent Items portion.
It highlighted the part of my life my gf understands but doesn’t really wanna see either. XD
following script when ran will clear the file
#!/usr/bin/env python
import os
home = os.environ.get(‘HOME’)
bookmark_path = ‘.local/share/recently-used.xbel’
from xml.etree.ElementTree import ElementTree
tree = ElementTree()
root = tree.parse(os.path.join(home,bookmark_path))
root.clear()
tree.write(os.path.join(home,bookmark_path),encoding=”utf8″)
print “cleared your bookmarks”
delete recently-used.xbel (usually found in ~/.local/share/)
right click & create new file & rename to ‘recently-used.xbel’
right click & goto properties of that file,goto permission tab,change Access from ‘Read and write’ to ‘Read-Only’ close the properties window.
More elegantly (in my opinion):
cat /dev/null > ~/.local/share/recently-used.xbel
hey… the python script does not work…
#!/usr/bin/env python
import os
home = os.environ.get(‘HOME’)
bookmark_path = ‘.local/share/recently-used.xbel’
from xml.etree.ElementTree import ElementTree
tree = ElementTree()
root = tree.parse(os.path.join(home,bookmark_path))
root.clear()
tree.write(os.path.join(home,bookmark_path),encoding=”utf8″)
print “cleared your bookmarks”
Traceback (most recent call last):
File “./clearrecent.py”, line 8, in
root = tree.parse(os.path.join(home,bookmark_path))
File “/usr/lib64/python2.7/xml/etree/ElementTree.py”, line 653, in parse
parser.feed(data)
File “/usr/lib64/python2.7/xml/etree/ElementTree.py”, line 1624, in feed
self._raiseerror(v)
File “/usr/lib64/python2.7/xml/etree/ElementTree.py”, line 1488, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0
Command line
echo “” > local/share/recently-used.xbel
Here’s a better way:
1. Open the looking glass by pressing Alt+F2 and then typing lg
2. Enter “imports.gi.Gtk.RecentManager.get_default().purge_items()”
Of course, it would be trivial to write a gnome shell extension that integrates this in some menu.
+1 for Phil’s comment. Much cleaner
Phil posted:
More elegantly (in my opinion):
cat /dev/null > ~/.local/share/recently-used.xbel
*even” More elegantly (in my opinion) i.e. permanent fix:
rm ~/.local/share/recently-used.xbel
mkdir ~/.local/share/recently-used.xbel (stops the file being created / repopulated as it’s now a folder!