Accidentally changed the bashrc file when making a change cannot find it in terminal though it appears in file browser
I was making a change to bashrc to set JAVA as a login variable when i accidentally saved it with a new name, when i go into file browser i can see the file but when i look for it in console it isn't there, I am very new at linux so any help is appreciated.
|
May be a silly answer, but have you tried:
Code:
ls -la but -a shows all files, including hidden files, which wouldn't show up with a standard ls. |
Quote:
Code:
ls -a |
Member response
Hi,
Welcome to LQ! Quote:
Quote:
Have fun & enjoy! :hattip: |
Found
I can see the bashrc file in there and it seems fine, its just that when i try to do nano~/ .bshrc it can't perform the action as it can't locate the file
|
Quote:
Code:
nano ~/.bashrc |
As said above, it is a 'dot' file, generally hidden from a user because it affects how your system works.
To edit it use Code:
nano .bashrc |
I have done that and now the files empty.
I forgot to mention i located the file already using the nano ~/.bashrc and then when i edited to set up a variable i accidentally saved it under a different name and i can't find that file |
If you know what you called the file you could try:
Code:
locate filename |
^ locate might not help in this case.
try Code:
find -name '*filename' |
You could also try
Code:
ls -lrta |
The environment variable $HOME and the shorthand ~ are equivalent depending on your shell / use case.
$ nano $HOME/.bashrc |
If you are saying that you saved the file under a different name, & can't remember what name, you can search by using the date that you created the file. :)
|
All times are GMT -5. The time now is 05:50 AM. |