Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is a little embarrassing but I'm unable to delete the root user shell history from a FreeBSD 10.0 server. The root user is using the default csh.

I've tried the classic history -c command to clean up the history and it works... until I logout and login on the server again.

Tried to remove the ~/.history file without success too.

Any ideias of what to do?

share|improve this question

3 Answers 3

This command:

rm /root/.history

should do what you're after, though it may be getting written back out when you logout. If you simply want history never stored, you could do this:

echo > /root/.history
chflags schg /root/.history

which empties the file then sets it immutable.

share|improve this answer
I'm voting up your answer, but I've already done the rm option and it was no effect, which is insane to me. I've tried even rewriting the history file with not effect. –  Vinícius Ferrão Jul 4 at 2:51

Not 100% sure if HISTSIZE variable exists in (t)csh, but it might.

So try with

setenv HISTSIZE 0
rm -f /root/.history

And see if it helps.

share|improve this answer

This might works for you too not sure for (t)csh shell

history -w


rm .bash_history
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.