Thursday, May 2, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 90240  / 1 Year ago, mon, march 20, 2023, 6:28:00

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:




  1. In my home directory I am editing the .profile file.

  2. 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"
    fi

  3. I logout and log back in.


  4. 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?


More From » home-directory

 Answers
1

  • The code in the if statement is only used if there's a directory $HOME/bin is a directory

  • I needs to be /home/vincent/google_appengine instead of home/vincent/google_appengine or (even better) $HOME/google_appengine because home is relative and /home is absolute.



Use



export PATH="$PATH:$HOME/google_appengine"


Remember anything in the $PATH before google_appengine will override it.


[#37761] Wednesday, March 22, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ugeeport

Total Points: 181
Total Questions: 108
Total Answers: 99

Location: El Salvador
Member since Tue, Jun 29, 2021
3 Years ago
ugeeport questions
;