In an attempt to unlock the screen, I have accidentally entered my password into a terminal running the fish shell.
How can I remove it from the command history of fish again?
The solution does not need to be forensically secure. Traces left in backup files or on the drive are fine with me. I just want to avoid e.g. my password accidentally popping up in a screen sharing session when I use fish's history while sharing. And I want to keep all the other commands in the history, because I often recall complicated commands from the history, sometimes editing them before reusing.
You want history delete
. That should ask you for a search term, show you matching entries and ask you for which to delete.
Just an addition to history delete
.
--contains
/ -c
- Shows you the results in a prompt before it gets deleted. Since it is the default, you do not need to specify the flag as shown in the examples.
Another handy shortcut history clear-session
will only delete the current session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With