1 |
Bruce Hill <daddy@×××××××××××××××××××××.com> wrote: |
2 |
|
3 |
> On Wed, Jan 08, 2014 at 07:10:10AM -0500, Tanstaafl wrote: |
4 |
> > Hi all, |
5 |
> > |
6 |
> > I routinely am logged into a server with multiple consoles (I log in |
7 |
> > with one (the same) regular user, then su - to root). |
8 |
> > |
9 |
> > This morning I tried to grep roots .bash_history for a command I ran |
10 |
> > some time ago, and it wasn't there. I know I ran it, so I'd like to |
11 |
> > configure my bash history so this doesn't happen again. |
12 |
> > |
13 |
> > Thinking about it a bit, the first issue I see is... when I am running |
14 |
> > multiple consoles, each one having been started by first logging in as |
15 |
> > my normal user, then su - to root, how does this affect the |
16 |
> > .bash_history file? It seems like there would be a collision of some |
17 |
> > kind, maybe result in the last one to log out 'winning' (that |
18 |
> > .bash_history is the one that is saved/stored) or something? |
19 |
> > |
20 |
> > Maybe... would it be possible to use different regular users, then when |
21 |
> > each one does the su - to root, have it create a separate .bash_history |
22 |
> > file based on the original username? That would be perfect. |
23 |
> > |
24 |
> > I was also considering something like setting HISTSIZE=###, then adding |
25 |
> > something to the logrotate.conf file to start rotating the history file, |
26 |
> > so I don't lose anything - but I'm not sure if that would even work. |
27 |
> > |
28 |
> > So, I'm interested in how others do this... especially on a system that |
29 |
> > has multiple users managing it. |
30 |
> > |
31 |
> > Thx... Charles |
32 |
> |
33 |
> Long ago living in a country far away on computers long since abandoned, some |
34 |
> friendly sysadmin helped me set this up. For quite some time this has been on |
35 |
> my "TO-DO" wishlist, so your query caused me to search the internet: |
36 |
> |
37 |
> http://mywiki.wooledge.org/BashFAQ/088 |
38 |
> |
39 |
> Hope this helps you and I both append our history for all open terminals. |
40 |
|
41 |
|
42 |
Thanks, I thought history was always appended,but now I know. |
43 |
|
44 |
-- |
45 |
Your life is like a penny. You're going to lose it. The question is: |
46 |
How do |
47 |
you spend it? |
48 |
|
49 |
John Covici |
50 |
covici@××××××××××.com |