Ubuntu – Locate Files and Directories ‘Recently Used’


On my Ubuntu 12.04, all the gnome applications (such as Nautilus, Evince, gedit, firefox) can access "Recently Used" files and directories, when opening files in them.

  1. I wonder where the information about "Recently Used" files and
    directories is stored? I would like to access the "Recently Used"
    files and directories from terminal, by reading such information.
  2. KDE and wine applications can't access "Recently Used" files and
    directories. I wonder why?


Best Answer

  1. The Recently Used information is stored in a file called recently-used.xbel located under the .local/share directory per user, the full path being:


    It contains metadata on the recent files, like what is the application that opened it, or the application that should display it in its history.

    For example, my gedit shows 3 files:

    If I search for gedit in the file, I can surely see 3 "stanzas" because there are 3 files, here's one of them as a sample:

    <bookmark href="file:///path/to/dsasd" added="2014-07-26T19:22:24Z" modified="2014-07-26T21:52:22Z" visited="2014-07-26T19:22:25Z">
      <metadata owner="http://freedesktop.org">
        <mime:mime-type type="text/plain"/>
          <bookmark:application name="gedit" exec="&apos;gedit %u&apos;" modified="2014-07-26T21:52:22Z" count="7"/>

  2. The recently-used.xbel file is part of the GTK+ toolkit. I tried looking for some documentation on it, but this is the closest I can get:

    GNOME uses the GTK+ library, while KDE uses the QT library, I assume that's why it doesn't work with KDE. As for wine, I don't know, maybe it's just not designed to work with it.

Related Question