Saturday, May 4, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 7066  / 3 Years ago, wed, september 1, 2021, 7:53:23

I recently messed up my .bashrc file, which I mentioned in this question: How do I restore .bashrc to its default?, and I can't find a way to restore .bashrc to its default that works.



I can't make commands in the terminal because every time I try I receive an error message along the lines of




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




On other questions I have seen that some recommendations for this problem involve using default files in /etc/skel/ (Problem in .bashrc ).



This won't work for me, as I looked in /etc/skel/, and realized that I have practically no files at all in there! I don't know why this is.



Also, solutions that involve using the terminal don't seem to work because every time I use the terminal I get the above-mentioned error message.



I'd be really appreciative if anybody could help me solve this problem. I'm somewhat new to Ubuntu, and I'm having difficulties with this issue.


More From » command-line

 Answers
2

Most of the default files in /etc/skel are hidden ('dot') files, so to see them in the GUI file manager you will need to Show hidden files from the menu or use the Ctrl+h key combination.



To see them in a terminal you will need to use ls -a or ls -A i.e.



ls /etc/skel
examples.desktop


but



$ ls -A /etc/skel
.bash_logout .bashrc examples.desktop .profile .Xdefaults .xscreensaver


Until you have fixed your path you will need to use the full path to each command e.g. /bin/ls, /bin/cp e.g.



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


For the new .bashrc file to take effect, you will need to start a new shell or log out and back in - or you can source the new file in the shell using



source ~/.bashrc

[#27486] Wednesday, September 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
etzelmortg

Total Points: 430
Total Questions: 105
Total Answers: 106

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;