LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-16-2017, 05:16 AM   #1
HectorMHH
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 10-16-2017, 05:18 AM   #2
bloodh101
LQ Newbie
 
Registered: Oct 2017
Distribution: Arch
Posts: 5

Rep: Reputation: Disabled
May be a silly answer, but have you tried:
Code:
ls -la
The 'l' outputs it in list format (so optional)
but -a shows all files, including hidden files, which wouldn't show up with a standard ls.

Last edited by bloodh101; 10-16-2017 at 05:20 AM.
 
1 members found this post helpful.
Old 10-16-2017, 05:23 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,809
Blog Entries: 58

Rep: Reputation: Disabled
Quote:
Originally Posted by HectorMHH View Post
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.
If it's .bashrc, you need to enter:
Code:
ls -a
in the terminal or console to show hidden files, starting with a .
 
1 members found this post helpful.
Old 10-16-2017, 06:03 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,491
Blog Entries: 32

Rep: Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665
Member response

Hi,

Welcome to LQ!
Quote:
Originally Posted by HectorMHH View Post
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.
Other members have offered good suggestions for your query. For the future I recommend that you can learn from the following;
Quote:
Just a few links to aid you to gaining some understanding.

Hope this helps.
Have fun & enjoy!
 
1 members found this post helpful.
Old 10-17-2017, 04:30 AM   #5
HectorMHH
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-17-2017, 04:33 AM   #6
bloodh101
LQ Newbie
 
Registered: Oct 2017
Distribution: Arch
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by HectorMHH View Post
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
Just in case that's not a typo.
Code:
nano ~/.bashrc
Make sure theres a space after nano. If it can't find the file it should still open nano; It will say "[ New File ]" at the bottom.

Last edited by bloodh101; 10-17-2017 at 04:35 AM.
 
Old 10-17-2017, 05:07 AM   #7
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,284

Rep: Reputation: Disabled
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
 
1 members found this post helpful.
Old 10-17-2017, 05:55 AM   #8
HectorMHH
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-17-2017, 06:20 AM   #9
bloodh101
LQ Newbie
 
Registered: Oct 2017
Distribution: Arch
Posts: 5

Rep: Reputation: Disabled
If you know what you called the file you could try:
Code:
locate filename
 
Old 10-17-2017, 01:20 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,147
Blog Entries: 9

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
^ locate might not help in this case.
try
Code:
find -name '*filename'
instead
 
Old 10-17-2017, 01:41 PM   #11
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
You could also try
Code:
ls -lrta
in your home directory to list all files and sort them by last modified time. If you did this recently, your file should be listed near the end.
 
Old 10-18-2017, 07:55 AM   #12
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,994
Blog Entries: 1

Rep: Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846
The environment variable $HOME and the shorthand ~ are equivalent depending on your shell / use case.

$ nano $HOME/.bashrc
 
Old 10-18-2017, 02:20 PM   #13
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,284

Rep: Reputation: Disabled
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.
 
  


Reply


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
find the bashrc file sniper8752 Linux - Newbie 6 02-01-2013 10:03 PM
[SOLVED] Black Screen Appears Instead Of PDF File In-Browser, Fedora 15, Gnome3 bplis* Linux - Software 7 11-11-2011 04:55 PM
making aliases - no bashrc file disorderly Linux - Newbie 9 09-27-2004 05:57 PM
making alias, can't find .bashrc file djgerbavore Slackware 10 07-23-2004 09:23 AM
where could i find the file bashrc Paxmaster Linux - Software 4 07-15-2004 02:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration