How do I prevent the file 'recently-used.xbel' from being created?

Solution 1:

To disable the list for GTK 3 based applications follow these steps:

rm ~/.local/share/recently-used.xbel

If THERE ISN'T a "~/.config/gtk-3.0/settings.ini", then

mkdir -p ~/.config/gtk-3.0
    echo -e "[Settings]\ngtk-recent-files-max-age=0\ngtk-recent-files-limit=0" > ~/.config/gtk-3.0/settings.ini

If THERE IS a "~/.config/gtk-3.0/settings.ini", then

echo -e "\ngtk-recent-files-max-age=0\ngtk-recent-files-limit=0" >> ~/.config/gtk-3.0/settings.ini

(note the ">>" vs the ">" difference ; ">>" appends to a file while a single ">" completely overwrites it, without backup, if it already exists)

And in either case:

rm ~/.local/share/recently-used.xbel

To disable the list for GTK 2 based applications follow this step:

echo gtk-recent-files-max-age=0 >> ~/.gtkrc-2.0

These steps are better than changing permissions on the file as they prevent error messages from being shown when launching GTK based applications that rely on the file.

Detailed information can be found here - https://alexcabal.com/disabling-gnomes-recently-used-file-list-the-better-way/

Solution 2:

I've found that fiddling with the recently-used.xbel file has no effect (at least on Ubuntu 17.04+). You can delete it, clear it, /dev/null it, set it immutable, shoot it in any way and it won't work. For example Nautilus has a "Recently used" section hardwired into the side panel - and it's not deletable by any means and survives the .xbel file being wiped.

On GNOME / Ubuntu do this (which worked for me):

  1. Open a terminal and start gnome
$ gnome-control-center
  1. Navigate to the "Privacy Group" and click on "Privacy" enter image description here

  2. Click on "Usage & History" and on the following dialog set the "Recently Used" toggle to OFF.

Right when you do this, you can see the "Recently used" list in Nautilus going empty. (This also wipes the .xbel file - check it out.) Done.

Solution 3:

As before, whatever you do, it's always there. But you can make it immutable so it stops logging and stays empty. Command: sudo chattr +i ~/.local/share/recently-used.xbel .The system, and you as well, will not be able to do anything with it, until you change +i(immutable). This is the reverse command to restart logging back again: sudo chattr -i ~/.local/share/recently-used.xbel .(only if you want recently-used functioning again for some reason). I've had success clearing logs out by moving the folder to /dev/shm and shutdown computer. The folder comes back, empty.