Sometimes for server security, to prevent others from prying into the commands we enter, we can clear the history, and more often we choose to force history to not remember the command when entering special commands. Experimental method: Execute the Export histcontrol=ignorespace command first, then output Ls-tra, PWD and service mysqld Start command, when the third command is executed, we choose not to remember the command.
# export histcontrol=ignorespace
# ls-ltr
Total 168
-rw-r--r--1 root root 5520 Dec 25 2014 install.log.syslog
-rw-r--r--1 root root 12754 Dec 25 2014 install.log< BR>-RW-------1 root root 2005 Dec 25 2014 anaconda-ks.cfg
-rw-r--r--1 root root 1 2 dec 9 21:11 a.txt
# pwd
# service mysqld start ( Note that this command is preceded by a space)
and then we'll look at the history
# history |tail-3
844 2016-12-12 17:01:55 ls- LTR
845 2016-12-12 17:01:59 pwd
846 2016-12-12 17:02:36 History |tail-3
didn't find out what we just did, service mysqld start did not have
Note: If you do not want historical records to remember which command, directly in the execution of the command, add a space.
Of course someday you want to empty all history commands can be executed:
# history-c //Clear All Records
# history & nbsp;//to see if it is emptied
1 2016-12-12 17:12:12 history
#
Tags:linux History Sensitive commands
respect for sharing, welcome reprint, please consciously add this article link, thank you! This article link: https://www.601849.com/post/139.html
(go) How Linux makes history not log sensitive commands