I am new to Ubuntu (coming from Windows 7) and I am trying to add a directory to my system path and for some reason I can't get it to work. I am using Ubuntu version 12.04 LTS
I tried following this article without success How to add a directory to the PATH?
Here are my steps:
- In my home directory I am editing the .profile file.
Under the “# set PATH so it includes user's private bin if it exists” section I added the following:
if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH:home/vincent/google_appengine" fiI logout and log back in.
open the terminal window and type in:
vincent@ubuntu:~$ dev_appserver.py dev_appserver.py: command not found
The directory and files are in the location. What am I doing wrong?
2 Answers
- The code in the
ifstatement is only used if there's a directory$HOME/binis a directory - I needs to be
/home/vincent/google_appengineinstead ofhome/vincent/google_appengineor (even better)$HOME/google_appenginebecausehomeis relative and/homeis absolute.
Use
export PATH="$PATH:$HOME/google_appengine"Remember anything in the $PATH before google_appengine will override it.
Add this line at the end of .profile(or not inside an if statement):
export PATH=$PATH:/home/vincent/google_appengineExample .profile :
.
.
export LC_COLLATE="en_US.UTF-8"
export PATH=$PATH:/home/vincent/google_appengine 2