Monday, February 26, 2024
 Popular · Latest · Hot · Upcoming
181
rated 0 times [  181] [ 0]  / answers: 1 / hits: 248266  / 1 Year ago, tue, december 27, 2022, 10:05:37

I've been trying to install Android developer tools on Eclipse, and I followed the information in this video.



Like the video said, I added the following two lines of code to the .bashrc file:



export PATH=$(PATH):-/android-sdk/tools/
export PATH=$(PATH):-/android-sdk/platform-tools/


It seems, however, that this did not help me to install the Android files on Eclipse, as I am still having problems with that. What's more, it seems that I can't make any command in the terminal without getting a major error now! Every time I try to make a command in the terminal I get the following message:




The command could not be located because '/usr/bin' is not included in
the PATH environment variable.




Is there away to restore .bashrc to its default?


More From » bashrc

 Answers
2

Idea: There exist backup copies of .bashrc, .profile etc. in /etc/skel/. So one could replace a corrupt .bashrc simply by overwitting from there.



Caution: if you replace the .bashrc file with a fresh one, it will remove any other modification(s) you have made to it. For example, one could add aliases, custom function or PATH in .bashrc. When you replace the file, all those modifications will be lost. Better you can keep a copy of your modified .bashrc before replacing it. Later, you can carefully extract the required part from it. To keep a backup copy of your modified .bashrc in your home directory with name my_bashrc use the following in a terminal,



/bin/cp ~/.bashrc ~/my_bashrc


Why /bin/cp: In case if you have messed with your $PATH variable when changed ~/.bashrc all the executable will be unavailable from your terminal and cp will not work anymore. So it is recommended to call cp with its full path as /bin/cp while you are trying to copy something with corrupt ~/.bashrc.



Finally, use the following command in your terminal to replace the ~/.bashrc with a fresh copy,



/bin/cp /etc/skel/.bashrc ~/


It will replace your corrupt ~/.bashrc with a fresh one. After that, you need to source the ~/.bashrc so that the change takes place immediately, write in the terminal,



. ~/.bashrc


or,



source ~/.bashrc


or, if that does not work you can close the terminal and open it again.


[#27520] Thursday, December 29, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iriousutur

Total Points: 321
Total Questions: 112
Total Answers: 106

Location: Sweden
Member since Mon, Dec 7, 2020
3 Years ago
;