command line history of others


 
Thread Tools Search this Thread
Operating Systems AIX command line history of others
# 1  
Old 10-15-2009
command line history of others

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
# 2  
Old 10-15-2009
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.
# 3  
Old 10-15-2009
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:

Code:
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
# 4  
Old 10-15-2009
Try:
Code:
more ~username/.bash_history
more ~username/.sh_history

# 5  
Old 10-19-2009
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:

Code:
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

2. UNIX for Dummies Questions & Answers

using command history

Hi All. Suppose I am in a "verylongpath" directory and I type "gedit thisfile". At a later stage, the command is accessible from the hystory, but it is useless if I have moved to another directory. The same applies to "cd myfolder", etc. Is there a way to instruct shell history to... (1 Reply)
Discussion started by: bruno69
1 Replies

3. UNIX for Dummies Questions & Answers

history command

hi, i had to submit a project into a directory. i copied it from my location to the specified folder, no problemo. just one thing though. after i copied and searched for the time i copied using the history command, the system would not show. even using the up arrow key would not display my... (0 Replies)
Discussion started by: iluvsushi
0 Replies

4. UNIX for Dummies Questions & Answers

bash history and command line wrapping

By default, we use ksh (88) as our shell. I prefer bash, so I added this line to my .profile: exec bash -o viI also added this to my .bashrc?: #*********************************************** #These are important tweaks specific to BASH: #***********************************************... (1 Reply)
Discussion started by: mrwatkin
1 Replies

5. Shell Programming and Scripting

History Command

Hi all experts, I want to see all the command that is typed in the server 3 days ago. I typed HISTORY command but it does not show all the things. The reason is my senior DBA could see all the commands ran in the server 3 days ago but i cannot see. Please let me know is there anyway i can view... (6 Replies)
Discussion started by: ma466
6 Replies

6. Shell Programming and Scripting

need help in history Command

in my system history command is set to 60 how to remove all the command status even if i give history command. i mean: if i give history command in unix it should not show anything.........how to achieve this (2 Replies)
Discussion started by: ali560045
2 Replies

7. Solaris

^p not giving command line history.

I am used to using "set -o emacs" and then using "CNTL-P" for getting previous commands in solaris but on one host it does not work and instead just makes a DONG!! # ksh # set -o emacs # ls # ^p Can anyone offer guidance as to why this is? Thank you my friends. akbar (0 Replies)
Discussion started by: akbar
0 Replies

8. UNIX for Advanced & Expert Users

command line history

I am running Solaris 8 and using ksh. The history file (.sh_history) helps a lot, but it seems to get 'reset' after a certain period of time. In other words, after some usage of the shell, the command history would disappear and start anew. Is there some facility to specify the period of time to... (1 Reply)
Discussion started by: Sowser
1 Replies

9. UNIX for Dummies Questions & Answers

Command history

Hello everyone, I am aware about the history command we use in bash. Just had a question regarding the history of commands. Is there any way i can limit my commands to be remembered or is there any way to delete the commands used by myself? Thank you (8 Replies)
Discussion started by: a25khan
8 Replies

10. UNIX for Dummies Questions & Answers

History Command

Hi I am using ksh shell, and I am unable to use the command !n (where n is the number in the history list). Please help me... :confused: (2 Replies)
Discussion started by: jack
2 Replies
Login or Register to Ask a Question