View previous topic :: View next topic |
Author |
Message |
sulzla n00b
Joined: 20 Jun 2003 Posts: 8
|
Posted: Wed Feb 16, 2005 6:39 pm Post subject: Bash History |
|
|
Hello,
I'm working on getting a Gentoo system up and running and the one problem I'm having is that my command history does not seem to get saved. When I boot and then input commands, I can cycle through anything that I used after I booted, but nothing from a previous session. Right now I am logging in as root. Does anyone have a suggestion for how I could get my command history preserved from one login to the next? thanks. |
|
Back to top |
|
|
gentsquash l33t
Joined: 03 Nov 2004 Posts: 753 Location: Still a Gentoo beginner.
|
Posted: Wed Feb 16, 2005 9:05 pm Post subject: |
|
|
Does your user have a
file? What are its permissions? _________________ Your thread resolved? Putting [SOLVED] in its title helps all Gentooers. (Button "edit" , first post)
Prof. Jonathan LF King, Mathematics dept., University of Florida |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Wed Feb 16, 2005 9:18 pm Post subject: |
|
|
AFAIK bash reads .bash_history when opened, buffers the new one and writes back when it is closed. This might be confusing if you open multiple shells.
Moved from Installing Gentoo. |
|
Back to top |
|
|
sulzla n00b
Joined: 20 Jun 2003 Posts: 8
|
Posted: Wed Feb 16, 2005 10:13 pm Post subject: |
|
|
Yes, I do have the .bash_history in /root, but it also appears in /. The permissions for both of the files is -rw-------. I'm logging in as root, but I'm not sure which one of these should be used. Also, what does it mean when you write ~/ in front of the filename? Does the ~ just represent whatever path may apply to the situation? |
|
Back to top |
|
|
sulzla n00b
Joined: 20 Jun 2003 Posts: 8
|
Posted: Wed Feb 16, 2005 10:19 pm Post subject: |
|
|
As an update, I looked at the contents of both files mentioned above and the one in the / directory is full of commands from a few days ago while the one in the /root directory has only one command that was used a couple of hours ago. This is very strange since I have input many commands since this time. It seems that something is very wrong........ |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Wed Feb 16, 2005 10:21 pm Post subject: |
|
|
~/ points to your home dir (cd ~/ will cd you into your homedir.. ) Does it work normally for your normal user? |
|
Back to top |
|
|
sulzla n00b
Joined: 20 Jun 2003 Posts: 8
|
Posted: Wed Feb 16, 2005 10:33 pm Post subject: |
|
|
Yes it does work normally for my regular user. Furthermore, I've determined that the history is saved for root if I issue the logout command but not when I use reboot or poweroff. Am I doing this wrong? |
|
Back to top |
|
|
gentsquash l33t
Joined: 03 Nov 2004 Posts: 753 Location: Still a Gentoo beginner.
|
Posted: Fri Feb 18, 2005 9:15 pm Post subject: |
|
|
Replying to your earlier question, a construction such
as "~tux/" refers to the home directory of user "tux" (which is
likely to be "/home/tux/"). In contrast, "~/", I believe, refers
to the contents of the HOME environment-variable, and will be
fouled-up if HOME is mis-set. _________________ Your thread resolved? Putting [SOLVED] in its title helps all Gentooers. (Button "edit" , first post)
Prof. Jonathan LF King, Mathematics dept., University of Florida |
|
Back to top |
|
|
Massimo B. Veteran
Joined: 09 Feb 2005 Posts: 1806 Location: PB, Germany
|
Posted: Tue May 10, 2005 11:02 pm Post subject: |
|
|
I have the same problem.
There is a /.bash_history full of commands, but my own at /root/.bash_history is empty. cd goes to /root (as user root). _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Wed May 11, 2005 9:08 am Post subject: |
|
|
How do you login to root. Do you use su or su -. If you use just su then the root variables are not set and therefore it will probably not able to find your .bash_history.
So tryinstead |
|
Back to top |
|
|
|