Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Right now, I'm aware that for all commands typed into the console, the Ubuntu system logs it somewhere.

How can I disable logging of unix commands for all users?

share|improve this question
It would be helpful for future readers to understand why someone might wish to remove command histories. By way of counterpoint, users frequently retype the same or similar commands and can avail themselves of the ctrl-r, up arrow, or bang mechanisms. – dmourati Oct 3 '12 at 18:09

3 Answers 3

Try putting this in your /etc/profile:


This only works for shells which evaluate the systemwide profile like bash and sh, see bash manual. Not sure about other shells. Also, users need to logout and login again to make it work.

share|improve this answer
@Shi unfortunately I can't approve your suggested edit, so I have to do it manually. – Alexander Janssen Oct 3 '12 at 17:38
Funny. I couldn't approve it in the notifications, because I don't have enough points, but I was able to do it when I clicked on edit. – Alexander Janssen Oct 3 '12 at 17:40

You can also disable history using command

set +o history

This would be per shell. To make it permanent put it in /etc/profile

More details.

share|improve this answer

You can easely erase your current user command history using

history -c

useful if you typed a password as a commnad parameter.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.