As a newbie sys admin, how do i find out what other login session command line history, what are the commands they used?
Thanks.
leim
As a newbie sys admin, how do i find out what other login session command line history, what are the commands they used?
Thanks.
leim
It depends on the shell, AFAIK.
You could look in ~user/.history if it's been saved. I know that works for [t]csh, and I think bash does the same thing. Not sure of the other shells.
Hi,
You can login as super user on a Unix box and can use History command to check the command line history of other users. If you want to check for last N commands of a user you can give:
history 5
This will show last five commands executed by user.
Please search Google for more information as Goggle is your best freind.
I am providing you with one link which you can refer:
History Command
Thanks,
Shazin
Try:
more ~username/.bash_history
more ~username/.sh_history
With AIX the standard shell for users is the Korn shell. bash, [t]csh and other shells may or may not be installed, but ksh can be relied to be there. You can also find out the login shell of a user by one of the following two commands:
lsuser -a shell <username> | sed 's/^.*shell=//'
cat /etc/passwd | grep wolf | cut -d':' -f7
If the shell is ksh the history is stored per default in a file called ".sh_history" in the users home directory. It is possible to override this default by setting and exporting a variable called "HISTFILE", which wil have to point to a writable file. This file wil become the history file instead if the variable is set, usually in "~/.profile" or in "~/.kshrc", which wil both be executed at login (.kshrc every time a shell starts, .profile only at login time).
I hope this helps.
bakunin