Solve the problem that adding a space before a Linux command cannot hide the command record

Generally speaking, the linux system will save the record to the history by default after entering the command. You only need to enter the history command to view the historical command.

The hidden method is also very simple, just add a space before the command and it will not be recorded. But if you add a space, you can still see it in the history. You only need to enter the following command to hide it.

The following is a screenshot after modifying the configuration:

insert image description here

export HISTCONTROL=ignorespace

The demonstration effect in the figure above is obvious.

echo "123"  被history记录
 echo "312"  没有被history记录到

    All articles on this site are original, welcome to reprint, please indicate the source of the article: solve the problem that the command record cannot be hidden by adding a space before the Linux command .. Baidu and various collection sites are not trustworthy, please be careful when searching. Technical articles are generally time-sensitive. I am used to revising and updating my blog posts from time to time, so please visit the source to view the latest version of this article.

Guess you like

Origin blog.csdn.net/weixin_43847838/article/details/129260938