Lastcomm: displays the commands that the user executes on the host.

Source: Internet
Author: User
Article Title: lastcomm: displays commands executed by the user on the host. Linux is a technology channel of the IT lab in China. Some basic categories, such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems, use the lastcomm command to display the commands that the user (root and non-root) has executed 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.
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.