Adding a symlink to a directory already in your
PATH is often preferable.
If you want the software to be visible system-wide (by other users), add a symlink to
/usr/local/bin. If you want the software to be visible only by you, add once
$HOME/bin/ to your
PATH (some distributions are configuring the
bash shell to add that directory automagically if it exists) and add symlinks from it.
You should avoid having a very long
PATH (so avoid adding a directory in it for every newly installed applications), both for performance (but some shells are caching
PATH lookup, so that might not matter that much) and for maintainability purposes (you'll have a mess if your
PATH contain dozens of directories); this is also true for
LD_LIBRARY_PATH (so better add symlinks from
You might also consider using GNU stow which partly automate the process (I tried to use it a few years ago, but felt that it is not worth the burden).
At last, many software that you compile from source code can be configured to be installed somewhere else than under
/usr/local/ and its
/usr/local/bin/ directory. For free software configured with GNU autoconf facilities (i.e. having a
configure script generated from
configure.ac....), you may want to pass
--prefix=$HOME/pub/ --exec-prefix=$HOME/bin/ and some other options (e.g.
--program-suffix=-mine, ...) at build time.
A third method of doing would be to wrap your executable in some shell script which
export-s an augmented
PATH e.g. using
export PATH=$PATH:/opt/something/bin .... (this is necessary if the executable is forking more internal processes executed thru
execvp); BTW most firefox installations are doing that (so
mozilla would be a shell script ending with
exec mozilla.bin ....), or in a script which end by
exec-ing the full path. so you might simply add a small shell script as
$HOME/bin/ is already in your
# file $HOME/bin/sublimetext
# if needed add export PATH=$PATH:/Applications/Sublime\ Text.app/Contents/SharedSupport/bin
exec /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl "$@"
and you could even name that script
$HOME/bin/subl if you want to; don't forget to make your script executable with
chmod u+rx $HOME/bin/subl