0

i want to add the following directory to my path on the server, and i want it to stay permanently and be allowed to be run from anyplace this is the directory path:

/usr/local/texlive/2017/bin/x86_64-linux

i tired the following but if i exit the server and login again it is not there and if a website tried to call a function from the directory it can not see it

PATH=/usr/local/texlive/2017/bin/x86_64-linux:$PATH

what is the proper way to add this directory to my default $PATH and make this change permanent

Hazo
  • 33
  • 1
  • 7

1 Answers1

1

Depends on the shell you are using on the server if bash you could edit your .profile and add something like:

export PATH="/usr/local/texlive/2017/bin/x86_64-linux:$PATH"

If you want it to be for all users you could add it to a file in /etc/profile.d/path.sh.

/etc/profile and /etc/profile.d/*.sh are the global initialization scripts that are equivalent to ~/.profile for each user.

If using zsh add it to ~/.zshrc check this answer https://stackoverflow.com/a/10583324/1135424

If using csh, you could edit the .cshrc something like this:

set path = (/usr/local/texlive/2017/bin/x86_64-linux $path)
nbari
  • 25,603
  • 10
  • 76
  • 131
  • I opened /etc/profile.d/ but did not find path.sh should i create one there? What my profile.d has are bash_completion.sh Z97-byobu.sh and Z99-cloud-locale-test.sh – Hazo Oct 25 '17 at 07:27
  • Yes, you should create it, you could name it anything you want just needs to ends in `.sh` – nbari Oct 25 '17 at 07:28