Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture all the commands typed in Unix/Linux by any user?

Tags:

linux

shell

unix

I would like to capture all the commands typed in Unix/Linux by any user. There are few alternatives like using script command or acct utility. But the problem with them is they dumb everything from the terminal to a file or just provide the summary of the commands. I am looking for a utility where it will provide me all the commands typed by any user with the arguments for the commands. Is it possible? Are there any alternatives like making a hook into system calls to get this?

like image 696
vinayag Avatar asked Mar 29 '13 06:03

vinayag


People also ask

How can I see previously typed commands in Linux?

In Linux, there is a very useful command to show you all of the last commands that have been recently used. The command is simply called history, but can also be accessed by looking at your . bash_history in your home folder. By default, the history command will show you the last five hundred commands you have entered.

Which command in Unix displays the list of all the users?

who command – Display information about users who are currently logged in. users command – See the login names of the users currently on the system, in sorted order, space separated, on a single line. It reads all information from /var/run/utmp file.


1 Answers

I know this is old, but I think the script command might be what he was looking for?

> script my_output_file
Script started, file is my_output_file

http://www-users.cs.umn.edu/~gini/1901-07s/files/script.html

like image 111
TimeTrap Avatar answered Oct 13 '22 02:10

TimeTrap