The filtered directory is reached by setting an environment variable about the history command, and a timestamp can also be added.
The following methods can be added to the environment variable file to achieve permanent effect.
To add a timestamp to a history command:
Export histtimeformat= '%F%T '
Search history using Ctrl+r.
Number of historical command records
Export histsize=450
Export histfilesize=450
Change the file of the Record History command,
Export Histfile=/home/histroy_filename
Remove consecutive duplicate commands from a file
Export Histcontrol=ignoredups
Remove all duplicate entries from the file
Export Histcontrol=erasedups
Set the command filter to not remember the command being filtered. When the terminal enters the command, enter a space in front of the command that you do not want to remember, in combination with alias.
Export Histcontrol=ignorespace
8. Ignore remembering specific commands
Export histignore= "Pwd:ls:ls-l:"
Linux history (Histroy) command logging filtering