Linked by Tony Steidler-Dennison on Thu 10th Jul 2008 16:37 UTC
Linux The Linux desktop has come a long, long way, but there are still times when I have to use the command line. (I am a hardcore user, after all.) But even though I'm used to typing, spending hours upon hours with my fingers at the keyboard, I still grow tired of typing the same commands over and over. To reduce that tedium, I always add aliases to my .bashrc file.
Thread beginning with comment 322605
To read all comments associated with this story, please click here.
One I always use...
by UZ64 on Sat 12th Jul 2008 04:41 UTC
UZ64
Member since:
2006-12-05

alias clh="history -c && exit"

This will allow you to clear the bash history and then send the exit command by simply typing "clh". If you've got a terminal opened and have used su to become root or another user, typing this in will clear root's (or whoever you've switched to) bash history and then return you to your original user. If you're yourself (ie. haven't used su to become root), it will clear your own history and close the terminal. Of course, it has to be in the .bashrc files of any user who wants to use it (in my case, both my own personal home and /root). This will also completely wipe out the history, which may not be desired by everyone.