Author Topic: add to path  (Read 679 times)

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
add to path
« on: 26 June 2002, 10:03 »
I searched but couldnt find the thread where this was already answered (a while back). How do I add directories to my path???
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
add to path
« Reply #1 on: 26 June 2002, 10:30 »
quote:

vi ~/.bash_profile
after
PATH=$PATH:$HOME/bin
add
:/whatever

---------------------
New Q:
whats the diff between /bin and /sbin ??

[ June 26, 2002: Message edited by: Master of Reality / Bob ]

[ June 26, 2002: Message edited by: Master of Reality / Bob ]

Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
add to path
« Reply #2 on: 26 June 2002, 10:30 »
An interactive way is to:

export PATH=$PATH:/newdir1:/newdir2:etc

But you'll want to do this in your ~/.bash_profile.  Find the line that starts with "PATH" and add to it.

NOTE: Until you log off and back on the additions will not be recognized unless you do a ". ~/.bash_profile" in any new window/shell you open.

[ June 26, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
add to path
« Reply #3 on: 26 June 2002, 10:31 »
a little late, arent we VoidMain?
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
add to path
« Reply #4 on: 26 June 2002, 10:32 »
Damn you Bob!
Someone please remove this account. Thanks...

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
add to path
« Reply #5 on: 26 June 2002, 19:30 »
quote:
New Q:
whats the diff between /bin and /sbin ??
they're different directories? is this a trick question?

also i think it was a bit cruel to answer your OWN question and then TAUNT VoidMain over his trying to help!
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
add to path
« Reply #6 on: 26 June 2002, 19:40 »
void :

don't want to be a nitpick but usually it's desirable to put $PATH at the end, not at the beginning. I.E. qt defines a QTDIR, $QTDIR/bin is in your path, if you use multiple qt version typing export PATH=$PATH:$QTDIR/bin is not the same as export PATH=$QTDIR/bin:$PATH (in the first case, the $QTDIR/bin already present in the path will be used)

bob:

/bin is for normal binaries, /sbin is for binaries which require root priviliges (if I'm not mistaken)

Calum's answer is also entirely correct ofcourse though  :D
If you can't learn to do something well, learn to enjoy doing it poorly.

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
add to path
« Reply #7 on: 26 June 2002, 21:11 »
quote:
Originally posted by Calum:
also i think it was a bit cruel to answer your OWN question and then TAUNT VoidMain over his trying to help!
actually... taht is voidmains answer that i posted... I got it from another thread and changed it a little.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
add to path
« Reply #8 on: 26 June 2002, 22:25 »
quote:
Originally posted by BadKarma:
void :

don't want to be a nitpick but usually it's desirable to put $PATH at the end, not at the beginning. I.E. qt defines a QTDIR, $QTDIR/bin is in your path, if you use multiple qt version typing export PATH=$PATH:$QTDIR/bin is not the same as export PATH=$QTDIR/bin:$PATH (in the first case, the $QTDIR/bin already present in the path will be used)




No, no, no, no, no.  Did I say "no"?  UNIX Security 101.  You might as well put "." as the first directory in your path.  You always want the "system" directories first in your path, and then add what you want at the end (although even then you should be careful).  It opens you up for trojans if you do otherwise. If you would like examples I would be more than happy to give a few.

[ June 26, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...