0

I'd like to clear recent inputs in terminal not cls or clear but when you press up or down. How do I clear this list so that when I rename sudo to nodood or something you cannot press up to view the new sudo perhaps my script will read input.

EDIT: Note pressing Ctrl + R in terminal will let you search history like history | grep searchQueryString Another useful tip is sudo !! which re-executes last command with sudo prefixed

  • 4
    For complaints about the system use the meta site. For askubuntu that would be https://meta.askubuntu.com/ And it is of course an anti-spam measure. Please ONE question per topic. I answered the history part. The other one needs a separate question. – Rinzwind Oct 18 '18 at 13:50
  • It is me that removed the rant in the question. – Rinzwind Oct 18 '18 at 15:04
  • so after viewing the other post the history -c worked and about the mass renaming using mv . .*+datehashsuffix I will post a new question after having waited hours. And since I am not "well received" – Punkroku Oct 19 '18 at 05:26

2 Answers2

7

To clear your history use

history -c
Rinzwind
  • 299,756
3

Deleting history

  • If you only want to delete a single command (eg: you have erroneous typed your password) type

     history -d <line number>
    
  • In case you want to delete the entire history enter

     history -c; history -w
    
  • History files can be found in your home directory. For bash this will be .bash_history and the temp files .bash_history-xxxxxx.tmp. Hence deleting these files would be another option.

To find out more about history's hidden features take a look at the gnome bash manual.

abu_bua
  • 10,783