I am a complete unix noob so please forgive my simple question. I have a unix executable file located in a directory I generated. I believe I need to get this directory in my $PATH
so that the unix executable is executable, but the documentation for the source code says that I need to edit my shell configuration file to add $home/meme/bin
to my shell's path. Could anyone provide any help for me with this problem?
| ||||
feedback
|
If you want to be able to execute a program by typing its name on the command line, the program executable must be in one of the directories listed in the
You have several choices; while #1 and #2 involve less advanced concepts, I recommend #3 which is less work in practice:
| |||||||
feedback
|
You can add the new directory to your PATH temporarily, meaning for the duration of the current terminal session, with
This adds the new directory to the beginning of the PATH variable, while retaining all existing directories. If you want the modification to take effect permanently, in all future terminal sessions, you need to add the above line to the appropriate profile file in your home directory. Depending on how your distribution is set up, this might be called ~/.bash_profile, ~/.profile or something similar. Note also that you do not need to add a directory to your $PATH in order to execute a program inside it, you can also invoke the program by giving its full path, e.g.
or
if it is in the current directory. | |||||||
feedback
|