When someone says "in your path," what does this mean exactly?
They usually mean to
put your script or executable in one of the directories listed in the PATH environment variable, as shown by
echo $PATH
.or modify said variable to contain the directory where you script/program/application is
The PATH variable contains a list of colon (:
) separated directories to be searched for programs to execute. For example:
$ echo $PATH
/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games
You could put your program in e.g. /usr/local/bin
, so that it will be detected by other programs without you having to explicitly tell them to look at e.g. /home/user/apps/MyApp
.
Alternatively, you could modify that variable to contain /home/user/apps/MyApp
. For a single bash shell session, this would do:
$ export PATH="$PATH":/home/user/apps/MyApp
To do it permanently for bash you have to enter this line (without the $
shell prompt) in ~/.bashrc
or ~/.bash_profile
(or both).
If you have another shell (bash is the default for most Linux distributions) the commands above should be changed accordingly.
Well, here is a link by LINFO (The Linux Information Project) : http://www.linfo.org/path_env_var.html
It explains to you what it is, how you get it, how you change it, well, everything you need to know about it :)
Path is the name of an environment variable in an operating system. Linux, Unix, DOS, Windows and other operating systems have this concept. The Path environment variable defines the folders to be searched for a command or application to be executed. Hence, if X is the folder which contains your command or application, by adding X to your Path, it allows command, scripts or applications in X folder to be executed by just typing its name alone.
Try this "echo $PATH"
To add X (e.g. /home/x) to $PATH, type
PATH=$PATH:/home/x
In Linux or Unix, folders are separated by colon (:) while in Dos, Windows, etc, folders are separated by semi-colons (;)
http://lowfatlinux.com/linux-environment-variables.html