* showing command line history time format
# export HISTTIMEFORMAT='%F %T '
* controlling total number of lines in the shell history
Add the following lines to the .bash_profile
HISTSIZE=450
HISTFILESIZE=450
* Changing the history file name from .bash_history from any other
HISTFILE=/root/.my_command
* Eliminate the continuous repeated entry from history
after giving this if you type any comands repeately it shows only once in commandline.
* Erase duplicates across the whole history
# export HISTCONTROL=erasedups
* Force history not to remember a particular command
# export HISTCONTROL=ignorespace
and when you execute a particular command, put a space before the command and that command will not showing in the history.
exp:- # service mysqld stop
There is a space at the beginning of service,to ignore this command from history.
* Disable the usage of history
# export HISTSIZE=0
It will not store anything in history
* Ignore specific commands from the history
# export HISTIGNORE="pwd:ls:ls -ltr:"
after this history will not record pwd, ls and ls -ltr, we can specify more commands here so .
# export HISTTIMEFORMAT='%F %T '
* controlling total number of lines in the shell history
Add the following lines to the .bash_profile
HISTSIZE=450
HISTFILESIZE=450
* Changing the history file name from .bash_history from any other
Add the following line to the .bash_profile
# vi ~/.bash_profileHISTFILE=/root/.my_command
* Eliminate the continuous repeated entry from history
To check this repeat some commands and after that export the following
# export HISTCONTROL=ignoredupsafter giving this if you type any comands repeately it shows only once in commandline.
* Erase duplicates across the whole history
# export HISTCONTROL=erasedups
previous commands will not go, only commands that come after this will have its effect.
# export HISTCONTROL=ignorespace
and when you execute a particular command, put a space before the command and that command will not showing in the history.
exp:- # service mysqld stop
There is a space at the beginning of service,to ignore this command from history.
* Disable the usage of history
# export HISTSIZE=0
It will not store anything in history
* Ignore specific commands from the history
# export HISTIGNORE="pwd:ls:ls -ltr:"
after this history will not record pwd, ls and ls -ltr, we can specify more commands here so .
No comments:
Post a Comment