LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 08-06-2006, 10:09 PM   #1
jasonnth
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Rep: Reputation: 0
bash history


if i login as root and run bash when i am root
where does command history log goes to after running bash?
i checked the .sh_history_root and my home directory and its not there
 
Old 08-06-2006, 10:19 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
If you login as root, the file should be /root/.bash_history
 
Old 08-07-2006, 03:07 AM   #3
jasonnth
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Original Poster
Rep: Reputation: 0
well, i saw the file .bash_history buts its empty
anywhere else the history log could go?
 
Old 08-07-2006, 03:13 AM   #4
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Usually it's under the user's home dir, so if /root is not the home directory, then try

Code:
cat $HOME/.bash_history
If it's not that, you've got to hunt someplace else.
 
Old 08-07-2006, 04:42 AM   #5
jasonnth
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Original Poster
Rep: Reputation: 0
odd, i use find command to search all the .bash_history
all of them listed are 0 bytes
could it be disabled by the system?

if so, anyone knows where the switch is?

thanks
 
Old 08-07-2006, 04:53 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Post your environment variables (the output of 'env' should do).
Especially look for variables whose name starts with HIST (ie grep for HIST), such as HISTSIZE & HISTFILE.
$HISTFILE can be used to set a specific location for the history file (instead of using the default).
$HISTSIZE, if set to 0, will probably disable the command history.

See also the man page of your shell.
 
Old 08-07-2006, 10:26 PM   #7
jasonnth
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Original Poster
Rep: Reputation: 0
HISTSIZE=2000

HISTFILE=/root/.sh_history_jasonnth
 
Old 08-08-2006, 01:35 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
As $HISTFILE indicates, the file you're looking for is /root/.sh_history_jasonnth.
It should contain (at most) 2000 commands.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the history stored (bash)? syssyphus Linux - General 4 01-21-2006 03:01 AM
Bash history file jinksys Linux - Software 2 07-30-2005 03:58 PM
NOT escaping bash history ivanatora Linux - General 3 06-07-2005 01:17 PM
bash history slowly Linux - General 2 11-12-2004 11:35 AM
Bash History ukndoit Linux - Security 2 10-16-2003 09:02 AM


All times are GMT -5. The time now is 08:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration