Article Title: displays the commands that the user has executed on the master machine. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
You can use the lastcomm command to display the commands performed by the user (root and non-root) on the host. The setting steps are as follows:
1. # vi/etc/rc2.d/S99acctadm
Acctadm-e basic-f/var/adm/exacct/proc process // The system account management process is automatically started every time the system starts.
Save and exit
2. # chmod 755/etc/rc2.d/S99acctadm
3. #/etc/rc2.d/S99acctadm
4. # lastcomm
......
Sh root pts/4 0.00 secs Thu Apr 7
Grep root pts/4 0.00 secs Thu Apr 7
In. telne root _ 0.01 secs Thu Apr 7 11: 32
Sh S guo2 pts/6 0.04 secs Thu Apr 7
Lastcomm root pts/5 0.04 secs Thu Apr 7
More root pts/5 0.01 secs Thu Apr 7
Df guo2 pts/6 0.00 secs Thu Apr 7
Mail guo2 pts/6 0.01 secs Thu Apr 7
......
The displayed command is all the commands recorded in the system cache. The system cache will create a temporary file record history command under the/var/tmp directory! The file will be deleted after the system restarts!
5. When lastcomm is used, it is recommended to put its output into a file and upload it down for check!
# Lastcomm>/tmp/lastcomm. log
6. Refer to the lastcomm command and acctadm command.