Trying to add locations to the PATH

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimpy
    New Member
    • Mar 2008
    • 7

    Trying to add locations to the PATH

    Greetings,

    When I open a terminal and enter :"echo $PATH", I receive this printout:
    james@james-desktop:~$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    I successfully add :
    PATH=$PATH:/home/james
    james@james-desktop:~$ PATH=$PATH/home/james
    james@james-desktop:~$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/home/james
    But when I close the terminal, and later reopen and check the path, the addition has disappeared. The path is back to the original path, sans the "/home/james".

    What way exists to save the change permanently?
  • micmast
    New Member
    • Mar 2008
    • 144

    #2
    open a terminal
    $> cd ~
    $> pico .profile
    or use vi whatever you prefer

    at the bottom it says someabout paths
    just add the
    PATH=/your/dir:$PATH

    reboot, that should work

    Comment

    • jimpy
      New Member
      • Mar 2008
      • 7

      #3
      Thank you for the reply, micmast.

      I tried your suggestion but only got a "Command not found" message.

      On a hunch, I tried just "pico" but that didn't prove fruitful either.

      Oh well, it will come, I suppose, one of these days.

      Again, thanks for answering.

      Comment

      • jlm699
        Contributor
        • Jul 2007
        • 314

        #4
        Originally posted by jimpy
        I tried just "pico" but that didn't prove fruitful either.
        pico is a text editor... so really you can use whatever your favorite one (if you have one already).

        It's strange that you don't have pico, either that or pico's not installed in the default location and/or the PATH doesn't point to it.

        My favorite editor is vim... so the command he suggested would be like:
        [code=bash]
        cd ~
        vi .profile
        [/code]

        So the pico, vi, etc is simply the program opening the file .profile (the . means that it is a hidden file so it won't appear on an ls unless you add the -a option [ls -a], which is like saying "list all files" (try ls --help for more info or check your man pages) ).

        Anyway, back on topic.... so if you have any text editor, be it emacs, vi, pico and the command "<favorite text editor here> ~/.profile" doesn't work, you could open the GUI version and use the File -> Open method to find/create your ~/.profile file

        sorry if any of that went over your head; I know learning Linux can be a daunting task, but there's plenty of documentation out there and forums for guidance like this one (however I might suggest swapping to the System Administration -> Linux / Unix / BSD forum if you have more questions about Linux in general and not Python).

        Comment

        • Laharl
          Recognized Expert Contributor
          • Sep 2007
          • 849

          #5
          Linux installs of, say, Ubuntu use GNU nano rather than UW pico. It's basically the same thing, but...so with nano, you'd use 'nano .profile' from your home folder to access this.

          Comment

          • jimpy
            New Member
            • Mar 2008
            • 7

            #6
            jim699 ..

            With your help I did finally got to and modified .profile.

            Thanks a lot for your explanations.

            Comment

            Working...