how to clear the input history in gnome terminal

Asked by gklau

i input some sensitive information in the command line of gnome terminal.
how to clear the input history in gnome terminal, thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Luky Winarto
Solved:
Last query:
Last reply:
Revision history for this message
Konstantin Konev (skfd) said :
#1

Possible solution is to invoke "history -c" to clear Terminal command history.
Also some changes to gedit ~/.bash_profile may be done. Add this lines:

unset HISTFILE
# to stop saving history at all

export HISTFILESIZE=1
# if you prefered to save history, you can set how many lines of cammnds to save

export HISTSIZE=1
# to set the number of commands to be remembered while the Terminal is running

Revision history for this message
Best Luky Winarto (luckyborneo) said :
#2

Hi gklau,

Open your terminal, then run this command:
$ history -c

Hopefully that will help you.

-Luky-

Revision history for this message
gklau (laugeenkeung) said :
#3

It is what i need.
thanks to Luky Winarto and Konstantin Konev