LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Deleted path variable how to return (https://www.linuxquestions.org/questions/linux-newbie-8/deleted-path-variable-how-to-return-877179/)

Donldh 04-26-2011 09:22 AM

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.

reed9 04-26-2011 09:31 AM

Edit /etc/profile

Put in something like
Code:

PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
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.
http://www.cs.purdue.edu/homes/cs348/unix_path.html

sibe 04-26-2011 09:36 AM

Hi,

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.

Telengard 04-26-2011 09:50 AM

Did you do something like this?

Code:

$ PATH=
$

If so then don't worry. PATH should be automatically restored the next time you login.


All times are GMT -5. The time now is 03:04 PM.