Results 1 to 4 of 4

Thread: How to modify $PATH

  1. #1
    Join Date
    Jan 2009
    Beans
    23

    How to modify $PATH

    How can i modify directories that are in $PATH? I mean from file, I don't really want to do it every time that I log in.

    Thanks

  2. #2
    Join Date
    Jan 2009
    Beans
    29

    Re: How to modify $PATH

    The file you need to modify is .bashrc .shrc (BASH) or .cshrc .tcshrc ((T)CSH).

    There you can modify $PATH. For example, in my .cshrc, I have:

    Code:
    set path = ($PWD ~/bin /bin /sbin /usr/{bin,sbin,X11R6/bin,games} \
    	    /usr/local/{,s}bin /usr/local/bin/java)
    UbuntuForums Registered NetBSD User #3

    Zelo zelatus sum pro Domino, Deo exercituum (1 Kings 19:14)
    Be still, and know that I am God. (Psalms 46:10)

  3. #3
    Join Date
    Jan 2009
    Beans
    23

    Re: How to modify $PATH

    I don't have any path word in my .bashrc file and I don't have any of the other files.

  4. #4
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: How to modify $PATH

    If you want to add some directory to your path, open a terminal and edit your ~/.bashrc.

    Code:
    gedit ~/.bashrc
    Add the following two lines to the end of it.

    Code:
    PATH=$PATH:/new_path:/another_new_path
    export PATH
    Save it. Then either log out and back in or "source" it.

    Code:
    source ~/.bashrc
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •