1846740 Members
4115 Online
110256 Solutions
New Discussion

Re: View log

 
sam_111
Trusted Contributor

View log

How to know what are the commands executed by a user on a file [Eg: touch]
"Hard Work always Pays off"
6 REPLIES 6
Mark Grant
Honored Contributor

Re: View log

YOu can look in there .sh_history file in their home directory. This isn't great though as it doesn't keep much history in there by default.
Never preceed any demonstration with anything more predictive than "watch this"
Steve Steel
Honored Contributor

Re: View log

Hi

There is a limit to the commands in history but

strings .sh_history|nl -ba


Will show what there is

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Ravi_8
Honored Contributor

Re: View log

Hi

.sh_history file under the user home directory contains the commands issued by user
never give up
Sanjay Kumar Suri
Honored Contributor

Re: View log

You can change the HISTSIZE environment variable as well.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
sam_111
Trusted Contributor

Re: View log

hi guys

sorry for being late.

I know that I can view .h_history file. but what about date and time details i.e when a particular command is executed. is this available any where ?

regards,

sam
"Hard Work always Pays off"
Bharat Katkar
Honored Contributor

Re: View log

Sam, as far as .sh_history is concerned u will be able to see only commands one has executed and i think that is the only way to see the executed commands.
U can try increasing the size of history by setting HISTSIZE variable to get more history.

Now if you see time stamp and other details then you have go through Log files. The most common one is /var/adm/syslog/syslog.log. I agree u won't be able to see all commands in that.

Further you can configure SYSLOGD daemon to log more details regarding the activities taking place on the System.

man syslogd will guide u properly in this regards.
That's all.

You need to know a lot to actually know how little you know