clean /tmp on bash logout
Edit your .bash_logout, just copy and paste in your bash prompt the following command.
cat <<EOF >> $HOME/.bash_logout
# Clean /tmp folder with my files and folders older than 3 days.
find /tmp -mindepth 1 -maxdepth 1 -ctime +3 -user $USER -exec rm -rf {} \;
EOF
It will keep your /tmp folder clean automatically.
Written by fibo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#