The default in the history command is not to show the time, if we want to show the time when using the historical command can be done by setting environment variables.
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430559272139140.png "alt=" 1.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430559272139140.png "/>
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430559307314911.png "alt=" 2.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430559307314911.png "/>
The specific parameters of the Histtimeformat variable are similar to those in the date command, and can be modified on the date-time format of the parameter Date command.
But if the result of the history command is exported to a file, it looks like this:
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430559645111484.png "alt=" 3.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430559645111484.png "/>
The number shown in the figure indicates the number of seconds from the beginning of the Unix period to the execution of this command.
Let's convert the number in the file into a format we can read:
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430560099996731.png "alt=" 3.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430560099996731.png "/>
Again to beautify the format, now look. Bash_history displays the results in a row with dates and commands, and looks awkward, and then uses the awk command to get them on one line:
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430560556644593.png "alt=" 4.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430560556644593.png "/>
It's time to see the history command, but there are a few more questions:
1, the environment variable setting is temporary, after exiting the session will disappear;
2. format. bash_history file command too long, can't remember;
1, environment variables can be written in the/ETC/BASHRC file to ensure that each login is automatically loaded.
2, as for that very long command, originally I wanted to write the command alias, but the command alias for the definition of the command with "" is not supported, so the command is written into the script.
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px ; border-right:0px; "title=" 1430561930651336.png "alt=" 1.png "src=" http://www.178linux.com/ueditor/php/upload/ Image/20150502/1430561930651336.png "/>
650) this.width=650; "Style=" border-bottom:0px;border-left:0px;height:auto;vertical-align:middle;border-top:0px; border-right:0px; "title=" 1430562094808908.png "alt=" 2.png "src=" http://www.178linux.com/ueditor/php/upload/image /20150502/1430562094808908.png "/>
Show History Command Time