Updating path unix
Updating path unix - dating phases
Note: The operating assumption in this article is that you have access to a machine running an operating system that uses Bash and that you know how to launch a shell terminal.
But what happens if you restart your computer or create a new terminal instance? The exact way to do this depends on which shell you're running. If you're using pretty much any common Linux distribution, and haven't changed the defaults, chances are you're running Bash. Like most everything in Linux, there is more than one way to do things, and you may find other answers which better meet the needs of your situation or the peculiarities of your Linux distribution. For further discussion, see this great thread on Stack Overflow. But you can confirm this with a simple command: For Bash, you simply need to add the line from above, export PATH=$PATH:/place/with/the/file, to the appropriate file that will be read when your shell launches. There are a few different places where you could conceivably set the variable name: potentially in a file called ~/.bash_profile, ~/.bashrc, or ~/.profile. The difference between these files is (primarily) when they get read by the shell.
If you're not sure where to put it, ~/.bashrc is a good choice. The PATH variable (always written in all caps) is an environment variable that contains a colon-delimited list of system directories.The directories are where commands are located, so that when you type a command, those directories are where the system searches for it.To see what's in your $PATH right now, type in: You'll probably see the directories mentioned above, as well as perhaps some others, and they are all separated by colons. Let's say you wrote a little shell script called and have it located in a directory called /place/with/the/file.This script provides some useful function to all of the files in your current directory, that you'd like to be able to execute no matter what directory you're in.For other shells, you'll want to find the appropriate place to set a configuration at start time; ksh configuration is typically found in ~/.kshrc, zsh (which I use) is in ~/.zshrc, etc.