I edit PATH and just insted $PATH i write SPATH sooo I'm stock in login loop
and with root terminal try to login and edit PATH
so, I don't know how to get bashrc with which command and how to edit PATH
33 Answers
You may know a few of these details, but I'm hoping to provide a list that will help you get through this.
.bashrcis found in a user's home directory./home/usera/.bashrc/root/.bashrc
$PATHshould beexport'd for persistence and sub-shells.- You will likely only ADD to
$PATH, and be careful not to reset it completely.- BAD
export PATH="/less/important/path:/lesser/important/path" - GOOD
export PATH="${PATH}:/less/important/path:/lesser/important/path"
- BAD
- The system will use the first found match, starting with directories on the left or beginning of the
$PATHlist.
If you find yourself with a really messed up configuration file, take a look at /etc/skel, and either copy that over, or use it as a reference for this and other configuration files provided to new users.
For editing path and saving it permanentaly, u can use vi editors for that.
Go to your home directory:
cd ~
type this command:
sudo gedit ~/.bashrc
this will ask you for root password, as you want to set the path.
make a variable
HOME = /home/user/data-> as your home to access the information. and use this variable like:PATH = ${HOME}/path_to_the_desired_application
before exiting the bashrc file, save the modified changes... This should work and you can edit your path in bashrc file.
Open root terminal(may be in recovery mode chosen at boot) and edit .bashrc with following command: replace "youruser" with actual user name
nano /home/youruser/.bashrcFix a typo and try to login as that user.
2