How to add a directory to your PATH

How to add a directory to your PATH

Julia Evans
@b0rk do you mind if I share my favourite $PATH deduplication trick?
@gnomon @b0rk is this the cursed one involving little-known readline shortcuts

@nev @b0rk SPOILERS NEV

(no, not this one)

edit: this was the cursed trick: https://mastodon.social/@gnomon/111206929341206118

@gnomon @b0rk slightly less cursed but still hacky way i found on stackoverflow (https://stackoverflow.com/q/53264235) and have been using ever since:

echo ${PATH} > t1
<editor> t1
export PATH=$(cat t1)

Overwriting a environment variable in linux

I wish to add a path to the PATH variable. I have copied the $PATH variable into a file called t1 using echo echo $PATH > t1 I then edited t1 nano t1 I added my path /usr/local/batch: to the

Stack Overflow