I've installed less
via
homebrew install less
but less
starts the system version of less
, not the one installed via homebrew. which less
shows:
$ which -a less
/usr/local/bin/less
/usr/bin/less
where /usr/local/bin/less
is a symlink to ../Cellar/less/487/bin/less
(homebrew less
)
and /usr/bin/less
is the system less
. echo $LESS
returns nothing. How can I start homebrew less
instead of system less
by default?
Best Answer
This might be due to bash's hash table of commands in
PATH
still using the old value. Remove the hash ofless
, or clear the hash, so that bash re-searchesPATH
:You can also manually add a path to the table:
From the Bash manual (emphasis mine):