Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-26-2011, 09:22 AM   #1
LQ Newbie
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Deleted path variable how to return

Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.
Old 04-26-2011, 09:31 AM   #2
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 142Reputation: 142
Edit /etc/profile

Put in something like
export PATH
Some distros do not include /usr/sbin or /sbin in the default $PATH, but it's not necessarily a problem to do so.

If you don't have a PATH variable, the shell doesn't know where to look for commands.
1 members found this post helpful.
Old 04-26-2011, 09:36 AM   #3
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21

if you don't have $PATH in your env variable, the shell won't be able to find the exact location of any command you enter at the command prompt.

To get a lost $PATH var, you can simply copy another user's $PATH to your ~/.bash_profile, assuming you use bash shell.
Old 04-26-2011, 09:50 AM   #4
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
Did you do something like this?

If so then don't worry. PATH should be automatically restored the next time you login.
1 members found this post helpful.



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
[SOLVED] Evolution e-mail: return to Inbox after message deleted Steve W Linux - Software 4 12-16-2010 05:16 AM
Add path to $PATH variable alaios SUSE / openSUSE 2 04-19-2009 08:41 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
can thread return a local variable? iclinux Programming 1 01-13-2005 11:37 PM
Sendmail return path dj_relentless Linux - General 2 06-07-2002 06:40 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:47 PM.

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