Artificial intelligent assistant

Keep getting the same result after "export PATH" I am doing this: $ which cabal /usr/bin/cabal $ export PATH=$PATH:$HOME/.cabal/bin $ which cabal /usr/bin/cabal I expect to get `/.cabal/bin/cabal` for `$ which cabal` (this path exists) after this. But I don't even after re-opening the terminal. How come?

The paths in `$PATH` are searched in order. This allows you to override a system default with:


export PATH=$HOME/bin:$PATH


`$HOME/bin` is now the _first_ (highest priority) path. You did it the other way around, making it the _last_ (lowest priority) path. When the shell goes looking, it uses the first match it finds.

In case it's not clear, this all works by concatenating strings. An analogy:


WORD=bar
WORD=foo$WORD


`$WORD` is now `foobar`. The `:` used with `$PATH` is literal, which you can see with `echo $PATH`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 449258badb8a60a2e28fad9a3bf8ee4d