command history & multiple root vt sessions

Polytropon freebsd at edvax.de
Thu Mar 30 00:45:19 UTC 2017


On Wed, 29 Mar 2017 11:35:36 -0400, Ernie Luzar wrote:
> I am at the keyboard that is wired to the computer.
> Using the Fx keys I logon as root in 3 different vt sessions.
> In each one issuing the "history" command shows a different set of 
> commands unique to that vt session. This is normal behavior.
> 
> How can this be? There is only a single /root directory on the host 
> system. All 3 vt sessions should be using the same .history file.

The shell usually reads history from memory, so the different
VT sessions use different histories while running.



> If I issue the "exit" command from the vt3 it should have updated the 
> /root/.history file with its session history content.

I had the same problem with user shell sessions inside X terminals.
This is what I added to /etc/csh.cshrc for global effect:

	set history = 200000
	set savehist = (200000 merge)

Maybe this also works for you?




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list