Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

For some reason I am successful in adding new directories to my $PATH but when I run the commands in the terminal the $PATH doesn't summon them.

I modified the $PATH in the ~/.bashrc file, and added the last directory

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:**/home/aldin/mybin/fasta-35.4.12/bin**"

But when I run the command it says command not found. However when I type the full path of the utility I'm able to run it.

Has anyone experienced this problem before? Do you know what I can do to fix this problem?

share|improve this question
4  
.bashrc is the wrong file, you should change PATH in .profile. See Alternative to .bashrc. Nonetheless, changing .bashrc should work when you launch applications from that terminal. Are you running a shell other than bash? Is your .bashrc read? Tell us what ps $$ shows in a terminal. If you add the line set -x at the top of .bashrc, what output do you see when you open a terminal? –  Gilles Dec 30 '12 at 16:41
    
I think that you will get what you want entering export PATH=$PATH:$HOME/aldin/mybin/fasta-35.4.12/bin. I hope that some user confirm or refute this information. –  Lucio Dec 30 '12 at 16:56

1 Answer 1

First, make sure that your restating your session. Either by closing the terminal window, or logging completely out and back in.

Next make sure your actually modifying the PATH with echo $PATH

If you are not aldin (or really even if you are) make sure you have permissions to see that directory and the executable file.

Finally make sure the command your trying to run is actually marked with the execute permission. Something like chmod a+x /home/aldin/mybin/fasta-35.4.12/bin/file.sh should work.

Also your modifying the PATH in a very dangerous way. Instead try:

PATH=$PATH:$HOME/mybin/fasta-35.4.12/bin/

NEVER (sometimes I wish there was a "super bold") modify the $PATH the way you are, always reference the current $PATH in there somewhere.

share|improve this answer
    
Gilles is also correct if your not running bash .bashrc won't do much good. –  coteyr Dec 30 '12 at 16:45
    
Aldo is modifying .bashrc, not .profile, so he doesn't need to log out and back in, only start a new terminal. The permissions on the files are ok, otherwise he woulnd't be able to execute the command with the full path. –  Gilles Dec 30 '12 at 16:52
    
@Gilles "logging in and out of your session".. may have been poorly phrased, but the point is, a new session is needed, either by closing and opening terminal, running bash by hand, or some other way. I will edit the answer. -- leaving log out and back in instead of assuming X. –  coteyr Dec 30 '12 at 17:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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