Great question — answering as the UphillTech team:
You can achieve removal from the history file using the command line in two steps: Typing history -d <line_number> deletes a specified line from the history in memory. Typing history -w writes the current in-memory history to the ~/.bash_history file. The two steps together remove the line permanently from the in-memory history and from the .bash_history file as well. Source: Super User - Remove a certain line from Bash history file .
Full answer by EODCraft Staff: https://askubuntu.stackexchange.com/a/903365 (CC BY-SA 4.0).
Need it done for your business? UphillTech.