Review your favorite Linux distribution.
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 07-13-2012, 06:22 AM   #1
Mohammed Zia
LQ Newbie
Registered: Jul 2012
Posts: 6

Rep: Reputation: Disabled
Set environment variable path

I am using UbuntuX86v12.04. Accidently I deleted all the paths saved in my ~/.bashrc file using terminal. I used "gedit ~/.bashrc" command to open it through terminal and after deleting, I saved it. Now I am not able to run any program or command. Each time the terminal is telling that the path is not included in my environment variable. I am not even able to use gedit to reopen ~/.bashrc file to undo changes. Kindly let me know how to add paths to environment varibales so that eveything would again get normal.


Old 07-13-2012, 07:33 AM   #2
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,196

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
I am not even able to use gedit to reopen ~/.bashrc file to undo changes.
Do you still have the file? What error messages do you get? Post them so we can help.

If you have deleted the file completely, you can create a new one.

Here is a link that shows how to add paths to your bashrc file.


Google is your friend.
Old 07-14-2012, 12:27 AM   #3
Mohammed Zia
LQ Newbie
Registered: Jul 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks dear for your suggestion. But I fixed the problem myself. I opened home directory and pressed "ctrl+h" to see the hidden files. There I found .bashrc file. From the terminal I checked how many paths are still present in my environment varibale using "echo $PATH" command. I simply added missing paths in continuation with the existing paths using ":/path/to/your/missing/directory". After this I restared the terminal and everything was OK.

Thanks for assistance!



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
PATH environment variable rupeshkp728 Linux - Software 4 07-12-2012 12:01 AM
How to set the PATH environment variable? red roses Linux - Newbie 4 04-25-2011 11:00 AM
Cannot correctly set up the PATH environment variable Centos dralexpe Linux - Software 7 05-31-2008 12:23 AM
PATH environment variable moonz Red Hat 3 09-08-2005 05:10 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 03:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:21 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
Open Source Consulting | Domain Registration