LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 04: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, 04: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 04:20 AM.
 
1 members found this post helpful.
Old 10-16-2017, 04:23 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

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, 05:03 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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, 03: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, 03: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 03:35 AM.
 
Old 10-17-2017, 04:07 AM   #7
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,491

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, 04: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, 05: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, 12:20 PM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

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

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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, 06:55 AM   #12
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

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

$ nano $HOME/.bashrc
 
Old 10-18-2017, 01:20 PM   #13
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,491

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



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

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

All times are GMT -5. The time now is 07:56 PM.

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
Open Source Consulting | Domain Registration