DEV Community

jastuccio
jastuccio

Posted on

Editing your fish history

Using your terminal history can save time or help you to remember commands you have not used in a long time. If you make typos in fish they still go into your history. There are a couple of ways to remove commands from your fish history.

Get a list and delete some or all of the commands that match the string:

history delete --contains "search string"
Enter fullscreen mode Exit fullscreen mode

example:
Alt Text


Open your history file. You can delete the command and time stamp for any commands you want to remove.

code ~/.local/share/fish/fish_history
Enter fullscreen mode Exit fullscreen mode

wipe everything clean:

history clear
Enter fullscreen mode Exit fullscreen mode

docs:
https://fishshell.com/docs/current/cmds/history.html

Top comments (0)