Results 1 to 6 of 6

Thread: adding a directory to PATH

  1. #1
    Senior Member SephStorm's Avatar
    Join Date
    Aug 2008
    Posts
    166

    Default adding a directory to PATH

    Hi,

    i'm trying to add my scripts directory to my path. I've done it before for my current session (though I cant remember how I did it...) but I wont to do it permanently. I did some research, and I should be looking for the .bash_profile file, but I cant seem to find it in my BT. I also looked at several other files, nothing had "PATH=$PATH" in it.

    can anyone give me some guidance?
    "You're only smoke and mirrors..."

  2. #2
    Senior Member daedalus1776's Avatar
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    112

    Default Re: adding a directory to PATH

    .bash_profile should be in /root
    if you run ls -la it should be there.

  3. #3
    Senior Member VulpiArgenti's Avatar
    Join Date
    Sep 2011
    Location
    lost
    Posts
    174

    Default Re: adding a directory to PATH

    I think the file you are looking for is /root/.bashrc.

    I added:
    Code:
    PATH="$HOME/Desktop/Scripts:$PATH"
    You can also use this file to do other useful things such as adjusting HISTFILESIZE, adding your own aliases etc

  4. #4
    Senior Member SephStorm's Avatar
    Join Date
    Aug 2008
    Posts
    166

    Default Re: adding a directory to PATH

    VulpiArgenti is correct, bash_profile was not there, but .bashrc was, and the relevant section was there. Any idea why our version use bshrc, whereas the general rule is bash_profile?
    "You're only smoke and mirrors..."

  5. #5
    Senior Member
    Join Date
    Jan 2010
    Posts
    126

    Default Re: adding a directory to PATH

    As this was asked in the "Beginner's Section",it may be worthwhile for future readers running into this and reading the thread; rather than a more direct attempt to answer your more Bt specific question. Still very much worth understanding and a pretty nicely done writeup

    http://www.linuxfromscratch.org/blfs...s/profile.html

  6. #6
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default Re: adding a directory to PATH

    It's a minor style/syntax thing but most Linux fanboi's would say that:

    Code:
    PATH="$PATH:$HOME/Desktop/Scripts"
    Is the preferred way of doing things. So that the "new" or "non-standard" things are added to the end of PATH not to the start of it. Also in this specific example it makes it more obvious that you're expanding upon PATH not HOME.
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

Similar Threads

  1. /rofs directory and root / directory & /dev/loop0
    By beauty in forum BackTrack 5 Beginners Section
    Replies: 0
    Last Post: 06-25-2011, 06:29 PM
  2. File path Problems
    By Gohanni in forum Beginners Forum
    Replies: 1
    Last Post: 06-12-2010, 04:30 PM
  3. Please explain how $PATH works
    By sephiroth111 in forum Beginners Forum
    Replies: 7
    Last Post: 04-19-2010, 02:58 PM
  4. $path
    By pentadavid in forum OLD Newbie Area
    Replies: 0
    Last Post: 09-29-2008, 09:07 AM
  5. Httprint work path fix
    By dapirates1 in forum OLD BT3beta Bugs and Fixes
    Replies: 3
    Last Post: 12-27-2007, 10:01 PM

Posting Permissions

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