What is the PATH?
Subject says it all.
Thanks! |
PATH is the default "paths" that your shell will look in for a command, it enables you to type mozilla instead of /usr/bin/mozilla because it looks for an executable in your current directory, then starts at the topmost directory specified in PATH of which /usr/bin is a part I'm booted into windows now or else I would give you a list of what directories are in my path but for the most part they consist of /bin /sbin /usr/bin /usr/sbin/ and /opt
|
An environment variable
linux is different then windows. The shell does not look in the current directory first. To execute in the current working directory use: ./<executable_name> To see your path echo %PATH |
I'd say echo $PATH works better. ;)
To add a directory to the path, say the bin directory in your home folder, simply type as follows: export PATH=$PATH:~/bin The PATH environment variable is a colon-separated list of directories and in the line above we set the $PATH to what it was before, plus the ~/bin directory. If you want to add a directory for to the path for all users you could put something like this in your /etc/profile: export PATH=$PATH:/whatever/directory/you/want/to/add:/and/another/one If you want to just do add it for yourself, add the above line to your ~/.bashrc and make sure ~/.bashrc is sourced (executed) from your ~/.bash_profile. Håkan |
All times are GMT -5. The time now is 12:31 PM. |