0

Imagine that I enter these commands in Konsole (Manjaro KDE terminal):

python3 script.py
clear
clear

Normally when I hit arrow UP key, I am able to scroll through recent commands: If I hit arrow UP key three times I should have these commands

clear
clear
python3 script.py

Is there a way to avoid having similar commands when hitting arrow UP key?
What I want here is to have

clear
python3 script.py

1 Answers1

0

Add the following to your ~/.bashrc if you're using bash:

export HISTCONTROL=ignoreboth:erasedups

If you're using zsh, you can try this in your ~/.zshrc(untested):

setopt HIST_IGNORE_DUPS
Bobbbay
  • 411
  • 3
  • 16