LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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
  Search this Thread
Old 08-16-2006, 12:58 PM   #1
vegetassj2
Member
 
Registered: Jan 2005
Posts: 201

Rep: Reputation: 30
howto add a dir to the path?


hey,

Could anyone plz tell me howto add /opt to my path?

thanks ^^

EDIT:
I don't need it anymore thanks anyways ^^

Last edited by vegetassj2; 08-16-2006 at 01:23 PM.
 
Old 08-16-2006, 01:01 PM   #2
FreeDoughnut
Member
 
Registered: Jun 2006
Distribution: Slackware 10.2, Debian Testing/Unstable, Ubuntu Breezy Badger, working on LFS
Posts: 228

Rep: Reputation: 30
Edit ~/.bashrc
It's pretty self explanitory. If you have any questions, let me know.
 
Old 08-16-2006, 01:03 PM   #3
vegetassj2
Member
 
Registered: Jan 2005
Posts: 201

Original Poster
Rep: Reputation: 30
oops I think I did something wrong ^^;;;

Code:
$su
Password:
bash: /root/.bashrc: line 9: unexpected EOF while looking for matching `''
bash: /root/.bashrc: line 15: syntax error: unexpected end of file
bash-3.1#
EDIT:
it's fixed now ^^
so where do I add the path?

Last edited by vegetassj2; 08-16-2006 at 01:07 PM.
 
Old 08-16-2006, 01:14 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Put back the original file. You did make a copy, did you

If you know what you changed, undo it. If not: Can you post the .bashrc file, it's probably a ' that's missing somewhere (as the error states).

PS:
- Always make a copy of the original.
- Always try these things as a normal user.
- In general: Only do things as root user if you cannot do it as a normal user.
 
Old 08-16-2006, 01:15 PM   #5
vegetassj2
Member
 
Registered: Jan 2005
Posts: 201

Original Poster
Rep: Reputation: 30
it's fixed I just accidentaly removed a ' in my alias list
so where do I add the path dir?

Code:
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias cls='clear'
alias rmf='rm -f'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Last edited by vegetassj2; 08-16-2006 at 01:21 PM.
 
Old 08-16-2006, 01:17 PM   #6
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
You can also do the following to add a Path

Export PATH = %PATH:<path_name_to_add>
 
Old 08-16-2006, 01:21 PM   #7
vegetassj2
Member
 
Registered: Jan 2005
Posts: 201

Original Poster
Rep: Reputation: 30
where shall I put it? ^^;;
 
Old 08-16-2006, 01:31 PM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

I do believe that FreeDoughnut gave you the wrong information.

Personal aliases and functions belong in .bashrc (as you correctly did).
Changes to the PATH environment variable on the other hand should go in .bash_profile. I have to admit that not all distro's do this correctly. Check to see if there is an entry that looks like this:

PATH=$PATH:/something

in your .bash_profile.

If it is, you need to change it to:

PATH=$PATH:/something:/opt

If the entry is missing altogether, add the following line to your .bash_profile:

export PATH=$PATH:/opt

Hope this helps.
 
Old 08-16-2006, 01:32 PM   #9
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I think you should only have to type it in once.
 
Old 08-16-2006, 01:36 PM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

@jstephens84:

Export PATH = %PATH:<path_name_to_add>

is incorrect, this should be:

export PATH = $PATH:<path_name_to_add>
 
Old 08-16-2006, 01:41 PM   #11
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
That happens from time to time when your fingers move faster than your brain. Thanks druuna
 
Old 08-16-2006, 02:02 PM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

@jstephens84: No problem, things like that happen

Just wanted to make sure there was no confusion.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing home dir path? NonSumPisces Linux - Newbie 4 08-22-2004 04:16 PM
adding a dir to PATH for root Villain Linux - Newbie 3 06-20-2004 03:49 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
how to add mandrake distro menu path dir to KDEDIRS mmodem Mandriva 0 11-15-2003 04:06 PM
Add Dir in Samba AMDPwred Linux - General 1 03-03-2002 10:16 PM


All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration