cat ~/.bash_history

7. history command

history Command executed for displaying the history, the format is "history [-c]".

history command should be the author's favorite command. Execution history command can show the most recent 1000 records the current user command executed on the local computer. If you feel that 1000 is not enough, you can also customize / etc / HISTSIZE variable value profile file. When using the history command, if you use -c parameter will clear all of the command history. You can also use "! Encoded digital" way to repeat the execution of a command once. In short, history command has a lot of interesting gameplay waiting for you to develop.

[root@linuxprobe ~]# history
1 tar xzvf VMwareTools-9.9.0-2304977.tar.gz
2 cd vmware-tools-distrib/
3 ls
4 ./vmware-install.pl -d
5 reboot
6 df -h
7 cd /run/media/
8 ls
9 cd root/
10 ls
11 cd VMware\ Tools/
12 ls
13 cp VMwareTools-9.9.0-2304977.tar.gz /home
14 cd /home
15 ls
16 tar xzvf VMwareTools-9.9.0-2304977.tar.gz
17 cd vmware-tools-distrib/
18 ls
19 ./vmware-install.pl -d
20 reboot
21 history
[root@linuxprobe ~]# !15
anaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates
Desktop          Downloads  Music                 Public    Videos

Command history is saved in the user's home directory file .bash_history in. Linux system with a dot (.) Represents the beginning of the file hidden files, which most system services file, you can view the contents of the file using the cat command.

[root@linuxprobe ~]# cat ~/.bash_history

To clear the current user is executed on the machine Linux command history information, run the following command:

[root@linuxprobe ~]# history -c

8. sosreport command

sosreport command is used to collect system configuration and schema information and diagnostic output document format sosreport.

When a Linux system fails you need to contact technical support personnel, most of the time they have to use this command to run a simple collection system status and configuration information services, in order to allow technical support personnel to remotely solve some small problems, so that they can or will advance understanding of some complex issues. In the following output information, bold collecting part is good and check code data compression files, send it to the technical support staff to:

[root@linuxprobe ~]# sosreport
sosreport (version 3.0)
This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

An archive containing the collected information will be generated in
/var/tmp and may be provided to a Red Hat support representative.
Any information provided to Red Hat will be treated in accordance with
the published support policies at:

https://access.redhat.com/support/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.
. Press ENTER to continue, or CTRL -C to quit here hit enter to confirm the information collection
 
Please enter your first initial and last name [linuxprobe.com]: where hit enter to confirm the host ID 
Please enter the case number that you are generating this report for : here hit ENTER to confirm the host ID 
Running the wait ... Please plugins. 
Running 70/70: yum ... 
Creating Compressed Archive ... 
Your sosreport Generated and has been saved in : /var/tmp/sosreport-linuxprobe.com-20170905230631.tar.xz at The Checksum IS: 79436cdf791327040efde48c452c6322 
Please File the send the this to your Support Representative.


Guess you like

Origin www.cnblogs.com/xuanbjut/p/11914652.html