How can I clear the recently used and viewed files without using terminal?
It depends on whether you're using Unity or the Classic desktop.
In Unity, the recent documents that you see in the Files lens are logged using Zeitgeist. If you don't want to use the terminal to remove these, or only want to remove a few of them, the best thing to do is install "Activity Journal" using the Software Center. Fire up the Activity Journal, and you'll see all your recently used apps and documents, grouped by day. If you right click a document and click "Delete item from Journal", Zeitgeist will forget that you used that document at that specific time. If you click "Delete all items with this URL", Zeitgeist will forget you ever used that document. If you want to delete everything, this terminal command (which others have already posted) will do the job:
rm ~/.local/share/zeitgeist/activity.sqlite zeitgeist-daemon --replace
There's a Zeitgeist Global Privacy app in development which will make this easier, but unfortunately it's not released yet.
The Classic desktop (and the lists of recently used files in most applications' File menus) stores a record of your recently used documents in ~/.local/share/recently-used.xbel. You can just delete this file using the file manager or copy and paste the following code into a terminal:
Hope that helps!
The only way I know how to do this is to install Ubuntu Tweak, which can be found by going to http://ubuntu-tweak.com/ and installing the software.
Open Ubuntu Tweak up and go to Gnome Settings then uncheck Enable System Wide "Recent Documents" List
You can use
bleachbit from its homepage on SourceForge or install it through the Software Center.
It can delete all unnecessary files, and system cache.
Open BleachBit and then check your preferences:
for deleting recent documents, only select System→recent documents
A while ago, I've developed a recent files indicator for Ubuntu 16.04 LTS, which was meant as personal project although I've used it to answer couple other questions here on Ask Ubuntu, particularly here and here. Among other features, it has an option to clear recently used files.
Obtaining the indicator is fairly simple:
sudo add-apt-repository ppa:1047481448-2/sergkolo sudo apt-get update sudo apt-get install files-indicator
This is what works for me, DISABLING ALL LOGGING.
Copy these three lines to a blank text file:
CREATE TRIGGER IF NOT EXISTS no_logging_uri AFTER INSERT ON uri BEGIN DELETE FROM uri ; END; CREATE TRIGGER IF NOT EXISTS no_logging_event AFTER INSERT ON event BEGIN DELETE FROM event ; END; CREATE TRIGGER IF NOT EXISTS no_logging_text AFTER INSERT ON text BEGIN DELETE FROM text ; END;
Let's suppose you named the file as
triggers.sql. The next thing to do is apply these triggers on the activity database:
$ cat triggers.sql | sqlite3 ~/.local/share/zeitgeist/activity.sqlite
If you want to restore the standard functionality simply remove the database (it will be recreated without the triggers):
$ rm ~/.local/share/zeitgeist/activity.sqlite
remove all children of xml file ~/.local/share/recently-used.xbel
<?xml version="1.0" encoding="UTF-8"?> <xbel version="1.0" xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks" xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info" />
$ sudo chattr +i ~/.local/share/recently-used.xbel
to make it immutable. drop all event item in sqlite3 database and also make it immutable.
$ sqlite3 ~/.local/share/zeitgeist/activity.sqlite sqlite> delete from event; $ sudo chattr +i ~/.local/share/zeitgeist/activity.sqlite