For security reason you may want to clear the history file and the screen when you hit CTRL+D or type logout command as you don’t want to left content on screen (i..e avoid an information leak). Some Linux distro may clear the screen but others do not clear the screen when you logout.
When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists. Basically you can use this file as the individual login shell cleanup file, executed when a login shell exits.
There is a simple solution to this problem, open your ~/.bash_logout file:
$ vi ~/.bash_logout
Append any one of the following command:
You can also reset your history by appending following commands:
First one will clear bash history and 2nd command will clear mysql command history using shell REDIRECTION operator >.TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop