That depends on your distribution. On some system, it’s deleted only when booted, others have cronjobs running deleting items older than n hours.
- On Ubuntu 14: using
tmpreaper
which gets called by/etc/cron.daily
, configured via/etc/default/rcS
and/etc/tmpreaper.conf
. (Credits to this answer). - On Ubuntu 16: using
tmpfiles.d
. (Credits to this answer). - On other Debian-like systems: on boot (the rules are defined in
/etc/default/rcS
). - On RedHat-like systems: by age (RHEL6 it was
/etc/cron.daily/tmpwatch
; RHEL7/RHEL8 and RedHat-like with systemd it’s configured in/usr/lib/tmpfiles.d/tmp.conf
, called bysystemd-tmpfiles-clean.service
). - On Gentoo
/etc/conf.d/bootmisc
.
Related Posts:
- How do I grep recursively?
- How do I grep recursively?
- How do I grep recursively?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- How can I exclude directories from grep -R?
- How can I exclude directories from grep -R?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- How to cat <
> a file containing code? - Extract file basename without path and extension in bash
- Given two directory trees, how can I find out which files differ by content?
- Diff command along with Grep gives “Binary file (standard input) matches”
- How to download a file from server using SSH?
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- What does `set -x` do?
- Command to change the default home directory of a user
- Using ls to list directories and their total sizes
- What does “&” at the end of a linux command mean?
- Can’t remove a directory in Unix
- Syntax error near unexpected token ‘then’
- C fopen vs open
- Restarting cron after changing crontab file?
- How do I write stderr to a file while using “tee” with a pipe?
- cd into directory without having permission
- Copying a large directory tree locally? cp or rsync?
- Can I nohup/screen an already-started process?
- Environment variables of a running process on Unix?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- SSL Certificate Location on UNIX/Linux
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- What does ‘set -e’ do, and why might it be considered dangerous?
- Meaning of directories on Unix and Unix like systems
- How to remove empty/blank lines from a file in Unix (including spaces)?
- How to forcibly close a socket in TIME_WAIT?
- How can I rename a Unix user?
- How to get pid of just started process
- Can you have more than one ~/.ssh/config file?
- How to disable everything in crontab -l?
- How to sort ps output by process start time?
- Why does ENOENT mean “No such file or directory”?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- -bash: syntax error near unexpected token `newline’ for display command
- Changing the resolution of a VNC session in linux
- Building HelloWorld C++ Program in Linux with ncurses
- How does “cat << EOF" work in bash?
- tar removing leading ‘/’ from member names
- X11 forwarding request failed on channel 0
- What is difference between arm64 and armhf?
- Opening a .tar.gz file with a single command
- How to make and apply SVN patch?
- connect to host localhost port 22: Connection refused
- Implementing shell in C and need help handling input/output redirection
- How to count lines in a document?
- Can you Run Xcode in Linux?
- How to get the process ID to kill a nohup process?
- Writing a simple shell in C using fork/execvp
- Implementation of multiple pipes in C
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- tar: add all files and directories in current directory INCLUDING .svn and so on
- What does set -e mean in a bash script?
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- What is `S_ISREG()`, and what does it do?
- Pipe to/from the clipboard in a Bash script
- what does -zxvf mean in tar -zxvf filename?
- Retrieve last 100 lines logs
- Linux Bash: Move multiple different files into same directory
- Configuring Apache for localhost
- how to search for a directory from the terminal in ubuntu
- Android – Command not found
- How to use dos2unix?
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- What does ‘bash -c’ do?
- How do I know the script file name in a Bash script?
- WordPress can’t find temporary folder, but folder it’s looking at has correct permissions
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- Communcation with wordrpess and linux server [closed]
- df in linux not showing correct free space after file removal
- Setting the hostname: FQDN or short name?
- Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?
- Disk full, du tells different. How to further investigate?
- Filename length limits on linux?
- best way to clear all iptables rules
- How can I port forward with iptables?
- Why do we use a OS Base Image with Docker if containers have no Guest OS?
- How to re-order windows, change the scroll shortcut, and modify the status bar contents in GNU Screen?
- How to make Windows 7 USB flash install media from Linux?
- How to install/change locale on Debian?
- What limits the maximum number of connections on a Linux server?
- How to prevent a user from login in, but allow “su – user” in Linux?
- I have a keypair. How do I determine the key length?
- How to do the port forwarding from one ip to another ip in same network?
- Why drop caches in Linux?
- Linux – Is there a way to prevent/protect a file from being deleted even by root?
- swap partition vs file for performance?
- Best way to disable swap in Linux
- How to remove invalid characters from filenames?
- How can I zip/compress a symlink?
- How to find the physical volume(s) that hold a logical volume in LVM