Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Questions about History file
Date: Wed, 08 Jan 2014 12:11:13
Message-Id: 52CD4022.2090504@libertytrek.org
1 Hi all,
2
3 I routinely am logged into a server with multiple consoles (I log in
4 with one (the same) regular user, then su - to root).
5
6 This morning I tried to grep roots .bash_history for a command I ran
7 some time ago, and it wasn't there. I know I ran it, so I'd like to
8 configure my bash history so this doesn't happen again.
9
10 Thinking about it a bit, the first issue I see is... when I am running
11 multiple consoles, each one having been started by first logging in as
12 my normal user, then su - to root, how does this affect the
13 .bash_history file? It seems like there would be a collision of some
14 kind, maybe result in the last one to log out 'winning' (that
15 .bash_history is the one that is saved/stored) or something?
16
17 Maybe... would it be possible to use different regular users, then when
18 each one does the su - to root, have it create a separate .bash_history
19 file based on the original username? That would be perfect.
20
21 I was also considering something like setting HISTSIZE=###, then adding
22 something to the logrotate.conf file to start rotating the history file,
23 so I don't lose anything - but I'm not sure if that would even work.
24
25 So, I'm interested in how others do this... especially on a system that
26 has multiple users managing it.
27
28 Thx... Charles

Replies

Subject Author
Re: [gentoo-user] Questions about History file Bruce Hill <daddy@×××××××××××××××××××××.com>
Re: [gentoo-user] Questions about History file Alan McKinnon <alan.mckinnon@×××××.com>