Because I'm not familiar with the way to add permanent path, I export the wrong dir accidently, which is /home/adolph/anaconda3/condabin. (It should be /home/adolph/anaconda3/bin)
adolph@adolph-System-Product-Name:~$ echo $PATH
/home/adolph/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/adolph/anaconda3/bin:/home/adolph/anaconda3/bin
I tried to remove the wrong directory in the method introduced by most of the post. reference1 reference2
adolph@adolph-System-Product-Name:~$ PATH=$(echo "$PATH" | sed -e 's/:\/home\/adolph\/anaconda3\/condabin$//')
However, it still exist. How to solve it in effective way?
adolph@adolph-System-Product-Name:~$ echo $PATH
/home/adolph/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/adolph/anaconda3/bin:/home/adolph/anaconda3/bin
sed
fails is that:\/home\/adolph\/anaconda3\/condabin$
only matches a trailing path component.) – steeldriver Mar 30 '22 at 21:20