LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 02-22-2004, 08:04 AM   #1
Junior
LQ Newbie
 
Registered: Feb 2004
Location: Singapore
Distribution: Redhat 7.2
Posts: 2

Rep: Reputation: 0
Unhappy How to set path environment?


Hi all,

I'm running on Redhat Linux 7.2 and very new to Unix command.
I had just downloaded Network Simulator 2.26.

I need to set this path "/home/junior/ns-allinone-2.26/bin", so that everytime I log in, I can start using my Network Simulator program.

How do I point my current path to this directory?

I understand that I need to modify my .bash_profile.
I can see .bash_profile when I do "ls -a", but how do I edit/open the content inside .bash_profile?

I did tried the following:

PATH=$PATH:"/home/junior/ns-allinone-2.26/bin"

But it still doesn't help. How do I use the commands "set path" and "export" to get the path going?

I had been struck at this for the past 2 weeks, please help....

thanks,
Junior
 
Old 02-22-2004, 09:08 AM   #2
eNTi
LQ Newbie
 
Registered: Jul 2002
Location: Austria - Salzburg
Distribution: gentoo
Posts: 20

Rep: Reputation: 0
you don't need to set a PATH to run your program. just type:

/home/junior/ns-allinone-2.26/bin/<your binary here>

if you want to do it in a more "clever" way, you'd better create a /home/junior/bin directory, create a link to every executable you want to be able to run from anywhere into that directory and set the PATH variable to /home/junior/bin.

in your .bash_profile (usually it's only .bash or .profile, but that might be different on a redhat system) write:

PATH="/home/junior/bin:${PATH}"
export PATH
 
Old 02-22-2004, 09:10 AM   #3
qwijibow
Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,670

Rep: Reputation: 47
what command line are you using ?

if its bash, edit the file $HOME/.bash_profile
 
Old 02-23-2004, 07:35 AM   #4
Junior
LQ Newbie
 
Registered: Feb 2004
Location: Singapore
Distribution: Redhat 7.2
Posts: 2

Original Poster
Rep: Reputation: 0
Hi,

I'm using bash as the command in Linux 7.2.

Sorry, I'm really new with this...what do you mean by <your binary here>?
/home/junior/ns-allinone-2.26/bin/<your binary here>

I manage to open my .bash_profile by using "view .bash_profile" command.
Inside the script reads....

PATH=$PATH:$HOME/bin

Should I edit the above to be......?
PATH=$PATH:$HOME/bin:/home/junior/ns-allinone-2.26/bin

How do I save whatever I type in the .bash_profile and make sure it points here the next time I log in?

I did tried to type the above in, but don't know how to save and get out of the program.


Regards,
Junior
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Universal Environment Path SET apocolpse Linux - Newbie 1 10-16-2004 02:56 AM
How to set PATH and CLASSPATH environment variables bronko Linux - Newbie 2 12-20-2003 11:13 AM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM
Changing environment path. JMC Linux - General 1 05-04-2002 03:50 AM


All times are GMT -5. The time now is 10:43 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration