How to Clear Recent Files History in Linux without Deleting Actual Files?

Abstract: Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Created: 2026-10-26 by

To clear recent files history in Linux without deleting actual data, you must remove the metadata entries stored in ~/.local/share/recently-used.xbel. This XML-based file tracks your activity for applications like Nautilus and Dolphin. Deleting this specific file or truncating it via command line instantly wipes the "Recent" list from your file manager interface while leaving all original documents intact on your disk.

Understanding the Recent Files Mechanism

Modern Linux desktop environments rely on a standardized protocol called XDG (X Desktop Group) to manage application state. One of these standards is the recently-used specification, which ensures that different applications can share a consistent view of what files you have accessed recently. The primary storage location for this information is typically ~/.local/share/recently-used.xbel. It is crucial to distinguish between the *history* of file access and the *files* themselves. The history is merely a log—a list of pointers or references to file paths. When you delete this log, you are not removing the underlying data structures, permissions, or contents of your documents. You are simply erasing the record that those documents were opened. This distinction is vital for privacy-conscious users who wish to scrub their activity trails without risking accidental deletion of important work. For users managing complex workflows, understanding how file managers interact with this database helps prevent confusion. If you are also looking to organize your workspace, you might find it useful to check out our guide on how to Effortlessly Move HTML Files and Folders in Linux, as proper file organization often complements privacy maintenance.

Method 1: Using the Command Line

The most reliable and universal method to clear recent files across any Linux distribution and desktop environment is using the terminal. This approach bypasses potential bugs in graphical user interfaces and ensures the file is completely cleared rather than just hidden. Open your terminal emulator. Navigate to your home directory if you are not already there by typing cd ~. To verify that the file exists and contains data, you can view its size using the ls -lh command on .local/share/recently-used.xbel. To remove the history, execute the following command:
rm ~/.local/share/recently-used.xbel
This command deletes the XML file entirely. Most modern file managers will automatically regenerate an empty version of this file the next time they launch, ensuring that the system remains stable. If you prefer not to delete the file but instead want to keep an empty structure, you can truncate it using:
truncate -s 0 ~/.local/share/recently-used.xbel
After running either command, close and reopen your file manager. The "Recent" tab should now be empty. Note that some applications may cache this data temporarily; restarting the computer or logging out and back in guarantees that no stale data remains in memory.

Method 2: Clearing History in Specific File Managers

While the command-line method works universally, some users prefer using the graphical interface provided by their desktop environment. However, these menus vary significantly depending on whether you use GNOME, KDE, or XFCE. GNOME Files (Nautilus) In modern versions of GNOME, the interface has shifted away from simple "Clear History" buttons in older locations. Instead, you often need to access the preferences directly. Open Nautilus, click the hamburger menu (three horizontal lines) in the top right, and select Preferences. Look for the Privacy tab. Here, you will find options to disable recording recent items or to clear them immediately. If the button is grayed out, ensure that the toggle for "Show recently used files" is active, as clearing requires the feature to be enabled first. KDE Plasma (Dolphin) Dolphin handles recent files slightly differently. Open Dolphin and go to Settings > Configure Dolphin. Navigate to the General or Behavior section. You may find a checkbox labeled "Remember recently used files." Unchecking this stops future tracking. To clear existing history, you often need to manually delete the recently-used.xbel file as described in Method 1, as Dolphin does not always provide a GUI button to purge the list completely. XFCE (Thunar) Thunar is known for its simplicity. Go to Edit > Preferences. Select the Advanced tab. Check the box for "Display the recently modified files in the sidebar." To clear the list, Thunar usually offers a "Clear" button within this dialog. If not, the same command-line deletion of recently-used.xbel applies perfectly here as well. If you are concerned about security contexts while managing these files, remember that editing system-level configurations often requires care. For broader context on privilege management, you might refer to our article on Run Programs with Elevated Privileges: A Comprehensive Guide, although clearing user history does not require sudo rights.

Preventing Future Tracking

Clearing your history is a reactive measure. To maintain ongoing privacy, consider disabling the feature entirely. In your file manager's preferences, look for settings related to "Recent Items," "History," or "Privacy." Disabling this feature prevents the creation of the recently-used.xbel file altogether, meaning there is nothing to delete later. Additionally, be aware that other applications beyond file managers track recent files. Text editors, image viewers, and even web browsers may maintain their own separate lists. For instance, Firefox stores recent documents in a separate JSON file within its profile directory. If you need comprehensive cleanup, you must address each application individually. Some enterprise environments use centralized policies to enforce these settings. If you are on a managed machine, contact your IT administrator before modifying these files, as group policies may overwrite manual changes.

Frequently Asked Questions

Does deleting recently-used.xbel affect my system performance?

No, deleting this file has no negative impact on system performance. The file is small and lightweight. In fact, keeping it indefinitely consumes negligible resources, so removing it does not speed up your computer but does enhance privacy.

Will clearing recent files delete the actual photos or documents?

Absolutely not. The recent files list is just a log of file paths. Removing the log removes the reference to the file, but the file itself remains exactly where you saved it. Your data is safe.

Why do recent files reappear after I clear them?

This happens because applications continue to run in the background and write new entries to the file. If you open a document after clearing the list, it will immediately appear again. To stop this, you must disable the "Record recently used files" option in your file manager's settings.

Can I clear recent files for a single application only?

The standard recently-used.xbel file is shared across many desktop applications. It is difficult to isolate a single app's history using this file alone. You would need to check the specific configuration folders of individual applications (like LibreOffice or GIMP) for their own separate history logs.

Is there a way to automate this process?

Yes, you can create a cron job or a systemd timer that runs the rm or truncate command at regular intervals. This is useful for shared computers where you want to ensure privacy after every session or at set times.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More