Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It's okay that there are history files logging the commands that has been used. That't not the problem. The problem is that when 2 admins are logged in to an AIX server then it could be bad:

If admin #A uses


then if admin #B hits the up arrow he gets the


command which is not a very good thing. So how can the termial be forced to only write the command history if the ssh session ended? (UPDATE#2: or solution could be that that each session has it's uniq command history, and thus we can't see each others command, only when they sign out for ex.)


4:root@SERVER:/root # echo $SHELL
4:root@SERVER:/root # oslevel -s
4:root@SERVER:/root # 
share|improve this question
Just for the record the behavior you are attributing to Linux is a bash feature other shells can behave differently. – Ulrich Dangel Jun 4 '12 at 0:36
I updated the question – gasko peter Jun 12 '12 at 5:32
which shell and version of shell are you using? – havexz Jun 21 '12 at 3:33
question updated, but there are machines with several oslevels – gasko peter Jun 23 '12 at 6:20
up vote 0 down vote accepted

If your admin's use sudo, instead of just su'ing to root, they'll retain their own command history.

Alternatively, you can use ksh's HISTFILE variable to set the filename for the history. Add,


to root's .profile. That'll generate a unique history file for every session, but you'll need some way to housekeep them.

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.