Clear global temporary folders
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Linux onlyThis script improves your privacy on Linux
-  Impact: HighSystem Functionality Loss Risk: High
 This action improves privacy with high impact when you run the recommended script.
- Bash (Shell script)These changes use Linux system commands to update your settings.
-  Fully reversibleYou can fully restore this action (revert back to the original behavior) using this website. The restore/revert methods provided here can help you fix issues. 
Overview
A temporary folder or temporary directory is a directory used to hold temporary files 1.
In Unix and Linux, the global temporary directories are /tmp 2 and /var/tmp 1. Typically,
/var/tmp is for persistent files (as it may be preserved over reboots), and /tmp is for more
temporary files 1.
Programs do not assume that any files or directories in temporary folders are preserved between invocations of the program, and these files may be deleted after reboot and in a site-specific manner 2.
See also: Filesystem Hierarchy Standard.
This script should only be used by advanced users.
This script is not recommended for daily use as it breaks important functionality.
Consider creating a system backup before doing any changes.
Sources
- Filesystem Hierarchy Standard. LinuxFoundation.org. (2022).
 Original: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s18.html
 Archived: https://web.archive.org/web/20221029152204/https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s18.html
- Temporary folder. Wikipedia. en.wikipedia.org. (2022).
 Original: https://en.wikipedia.org/wiki/Temporary_folder
 Archived: https://web.archive.org/web/20221029152135/https://en.wikipedia.org/wiki/Temporary_folder
Apply Now
Choose one of three ways to apply:
Help
How to apply or restore "Clear global temporary folders" using script
- ≈ 3 min to complete
- Tools: Web Browser
- Difficulty: Medium
- ≈ 5 instructions
- 1DownloadDownload the script file by clicking on the button above.
 Use button above to restore changes.
- 2Keep the fileIf warned by your browser, keep the file.
- 3OpenOpen the downloaded file.
- 4ExitOnce it's done, press any key to exit the window.
- 5RestartRestart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Clear global temporary folders" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2Choose script- Search for the script name: Clear global temporary folders
- Check the script by clicking on the checkbox.
 
- 3RunClick on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button. 
- Apply
- Revert
sudo rm -rfv /tmp/*
sudo rm -rfv /var/tmp/*
bnVsbA==
Help
How to apply or restore "Clear global temporary folders" using commands
- ≈ 2 min to complete
- Tools: Terminal
- Difficulty: Medium
- ≈ 3 instructions
- 1Open terminalOpen your terminal application.
- 2Copy codeCopy the code:
- 3Paste & runPaste the commands into terminal application and press Enter to run.Some changes require a system restart to take effect 
Similar Guides
Wider Goal
The guide below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.These plans combine multiple privacy settings, including this one, for stronger protection.
These scripts allow you to increase privacy by deleting collected data about you and your behavior.
Same Goal
Other guides in Privacy cleanup See settings that are in the same category as this guide.Using other actions in the same category may help you achieve your goal better.
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:- Expert review by undergroundwires- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
- Audited and verified using automated security tests
 
- Public review by large community- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
- Audited and verified using third-party security software
 
History
We continually monitor our guides, their impact and other potential privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.