Delete entry from Bash history

Posted on 20.10.16   Bash CLI Linux

First type history to see your bash command history.

Find the entry/command you’d like to erase from history and note the id on the left column.

history -d 1234

Replace 1234 with the actual ID.

Example:

$ history
  640  cd ~
  641  ls -la
  642  crontab -e
  643  exit
  644  free -h
  645  df -h
$ history -d 645
$ history
  640  cd ~
  641  ls -la
  642  crontab -e
  643  exit
  644  free -h

As you can see, the df -h command was erased from the history.

More on ITDB

How to debug a non starting application with ProcMon


Managing WiFi profiles in Windows 10


Change Resize Mode for all VMs in RoyalTS 4


Telnet alternative to check if port is open on host


Create a cmd alias/shortcut for issuing commands on remote computer