Is there any way to prevent showing duplicated entries in terminal?
Every time I go up, I see lots of repeated command until I find the command I want
In windows 10 version 2004 they fix this issue, although powershell save every command, but it will not show repeated command when you go up.
I wrote a script to remove duplicated entries starting the oldest, but I'd rather find a way to prevent showing duplicated entries
Here is my script if anyone want to remove the duplicated entries in terminal from the oldest.
tac .bash_history > a.txt
awk '!x[$0]++' a.txt > b.txt
tac b.txt > .bash_history
rm a.txt b.txt
ignoredupsas part of theHISTCONTROLparamater - see for example How to avoid duplicate entries in .bash_history – steeldriver Aug 22 '20 at 18:36