Just how to have different command history for various sessions for the very same customer?

I encounter this concern on several of Unix web servers. When I open various session for very same customer, command history is shared by all the session. This develops concerns if by chance I push Ctrl-P or up arrow and also simply press Enter. Once I wind up running rm -rf * the good news is I remained in directory site where I do not have approvals to remove documents.

Just how to have different command history for various sessions for the very same customer? A lot of the moment I am making use of ksh and also tcsh coverings.

0
2019-05-06 22:30:27
Source Share
Answers: 4

You can make use of screen. I additionally made a variable that was defined by my konsole profile and gave each of sessions a different history file, just means I can consider.

0
2019-05-08 20:41:54
Source

From the ksh faq :

Q1. Just how do I get different background apply for covering?

A1. ksh makes use of a common background apply for all coverings that make use of the very same background documents name. This suggests that regulates gone into in one window will certainly be seen by coverings in various other windows. To get different windows, the HISTFILE variable demands to be readied to various name prior to the first background command is developed.

0
2019-05-08 20:35:06
Source

You can add HISTFILE=~/.hist$$ to your .profile. This need to create an one-of-a-kind documents per session.

You will certainly wind up with a lot of .hist* so I recommend you remove them periodically.

0
2019-05-08 20:34:05
Source

I'm thinking you are speaking about synchronised sessions ; dividing sessions that desire each other isn't really valuable : you would certainly never ever have the ability to utilize it's background any longer, due to the fact that all sessions would certainly be one-of-a-kind. If that held true, you would possibly be far better off simply disabling command history.

If we are speaking about dividing synchronised session, I would certainly advise you make use of Bash. I'm rather certain I'm not obtaining the command history from 2 synchronised sessions blended with it. Slam just creates background to .bash_history at logout, so command history will not get blended till after logout. Given that making use of Bash serves, would certainly that address your concern?

0
2019-05-08 19:03:39
Source