In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Compare the historical command records of Unix and linux
The unix version used here is the solaris9,linux version of sun and the solaris9,linux version is centos5.5. Compare some similarities and differences between the two historical command records.
Solaris has a very useful accounting function, which records every command of each user by setting a log file, which is not enabled by default. In order to open it, you need to execute the accton file in the / usr/lib/acct/ directory in the following format: / usr/lib/acct/accton / var/adm/pact. In the sun manual, there is only one use, but this disadvantage is obvious. Most experienced people will not let go of the / var/adm and / var/log directories and find the pacct file. They will get the command history of root users and delete their own records at the same time. There is actually a good solution to this situation. Execute / usr/lib/acct/accton, followed by a separate directory and file. As follows: / usr/lib/acct/accton / home/log/commandlog. When the administrator wants to view the record, just copy the file commandlog to / var/adm, change it to pacct, and use the command lastcomm command to view the record. If you want to turn it off, type / usr/lib/acct/accton. That's it.
There is also a command history under Linux. By default, commands entered by users are recorded in ~ / .bash_history (take the default bash as an example), which can be viewed with the command history. Each user's command history is recorded in its own file.
Now speaking of the difference between the two, solaris uses syslogd to achieve the accounting function, recording each user's every command, all records are in the same file, using lastcomm to view, you can see the user and time to execute the command, but there are no parameters to record the command.
The command history in Linux is completed by bash (with bash as the default shell). Each command of the respective user is recorded, and the parameters of the command are recorded, but the time of execution of the command is not displayed by default. You can set up the history command to display the time of execution of the command. Such as the following settings:
# vi / etc/bashrc
Add the following three lines
# Let the system record the execution time of each history command. Note that there is a space in front of the last "sign.
Export HISTTIMEFORMAT= "" Y-%m-%d_%H:%M:%S "
# set the file size of the save history command
Export HISTFILESIZE=1000000
# number of commands to save history
Export HISTSIZE=2000
Save exit
Execute the command source / etc/bashrc to make the configuration take effect immediately.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.