1856631 Members
9321 Online
104113 Solutions
New Discussion

root history

 
Waugh
Frequent Advisor

root history

Hi,

What is the path of root history


Regards
Rkumar
4 REPLIES 4
Ivan Krastev
Honored Contributor

Re: root history

Normal is in root home directory. Check .profile or /etc/profile if it's modified to another location.

regards,
ivan
Jeeshan
Honored Contributor

Re: root history

normally it was not activated. but the .profile or /etc/profile or any other location of the root's profile can show you its history location.
a warrior never quits
sreekanthtm
Trusted Contributor

Re: root history

If my understanding is right, you are asking for 'Shell History file" for root user.

Login as root
#echo $HISTFILE will show the path

Normally set it to /.sh_history

Rgds
Sreekanth
Bill Hassell
Honored Contributor

Re: root history

root's shell history must be manually enabled. The root shell must always be /sbin/sh and to enable the shell history, add these variables to /etc/profile:

export HISTFILE=$HOME/.sh_history
export HISTSIZE=5000
export EDITOR=/usr/bin/vi

Then create the history file by logging in as root and type:

touch $HOME/.sh_history

Now logout and login again. Type any command such as ls, then type: ESC k CR (no spaces) where ESC=escape key, k is the letter k and CR is the Return or Enter key.


Bill Hassell, sysadmin