In order for this to work, you need to make sure the TeX binaries are in your path, and that the version you want to run is in your path before any other binaries with the same names. If you install TeX from your OS package manager, it should set this up for you.
However, many distros package an old version of TeX Live, and you might need to install a newer one. In that case, you will need to set up your
PATH for the binaries to work, as well as your
INFOPATH for the command-line documentation.
To make the TeX live installer work properly, the commands you must add to your login scripts are similar to
To enable them for all users, save them to a file, name it something like
chmod 755. To enable them only for your own user account, you would want to save them to
~/.bash_profile as well as
~/.bashrc, or to a single file that you
source from both of these. (And if you changed your login shell, you don’t need these instructions.)
I personally set up one more command, a shell alias to update my TeX installation. I have TeX Live installed as the system user
tex, which in theory means that an exploit in TeX Live at least should not get
alias update-tex='sudo -u tex -E $(which tlmgr) update --self --all'