Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
How can I make a program executable from everywhere

So, I'm new to Linux/Unix and am working in a corporate version of Red Hat at my company. Obviously I don't have full control over my computer (not sure if that matters).

I have a bunch of executables located in some folder.

I want to be able to run these programs from any other directory.

How can I make this happen? Some sort of bash profile file maybe? If so, where would that be located?

share|improve this question

marked as duplicate by Gilles, jasonwryan, Mikel, Renan, Ulrich Dangel Aug 25 '12 at 9:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer 1

up vote 1 down vote accepted

For this to work you add the /path/to/executables to the $PATH variable, to make this a default setting you add it to one of bash'es startup files, .bash_profile is probably the most appropriate one. Add the following line to $HOME/.bash_profile:

export PATH="${PATH}:/path/to/executables" 

Or if a PATH line already exists in .bash_profile, append or prepend /path/to/executables to it. Each of the path elements are searched in order, so if you want to override some commands, put your path first.

share|improve this answer
    
Forgive me, but I don't understand how to do this. When I type in the export PATH command: 'export PATH="$PATH:"/ep/home/eniven/gslib1/"', then I get an error "Bad : modifier in $ (/)". When I type the command:'export PATH="$PATH:"ep/home/eniven/gslib1"', I get the error: export: command not found. When I look in the directory /home/, there is nothing in there (no hidden files either) and I do not have write access to that directory. –  Flux Capacitor Aug 22 '12 at 21:37
    
PATH needs to be protected from parameter expansion, you can do this with curly braces, see update to answer. –  Thor Aug 22 '12 at 22:12
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.