Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bash History
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sulzla
n00b
n00b


Joined: 20 Jun 2003
Posts: 8

PostPosted: Wed Feb 16, 2005 6:39 pm    Post subject: Bash History Reply with quote

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
View user's profile Send private message
gentsquash
l33t
l33t


Joined: 03 Nov 2004
Posts: 753
Location: Still a Gentoo beginner.

PostPosted: Wed Feb 16, 2005 9:05 pm    Post subject: Reply with quote

Does your user have a

Code:
~/.bash_history


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
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Wed Feb 16, 2005 9:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
sulzla
n00b
n00b


Joined: 20 Jun 2003
Posts: 8

PostPosted: Wed Feb 16, 2005 10:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
sulzla
n00b
n00b


Joined: 20 Jun 2003
Posts: 8

PostPosted: Wed Feb 16, 2005 10:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Wed Feb 16, 2005 10:21 pm    Post subject: Reply with quote

~/ points to your home dir (cd ~/ will cd you into your homedir.. ) Does it work normally for your normal user?
Back to top
View user's profile Send private message
sulzla
n00b
n00b


Joined: 20 Jun 2003
Posts: 8

PostPosted: Wed Feb 16, 2005 10:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
gentsquash
l33t
l33t


Joined: 03 Nov 2004
Posts: 753
Location: Still a Gentoo beginner.

PostPosted: Fri Feb 18, 2005 9:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1776
Location: PB, Germany

PostPosted: Tue May 10, 2005 11:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Wed May 11, 2005 9:08 am    Post subject: Reply with quote

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 try
Code:
su -
instead
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum