LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-23-2011, 11:08 PM   #1
AceOfSpade
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 15
Accidental overwrite of .bashrc with different script.


Hey, so I have been working on this script and I just made a ridiculous error. I tried to move my script out of my home directory and for some reason I put in "mv myscript .bashrc" Now my .bashrc file has nothing but my script in there... I think I may have overwritten some important info. How do I fix this? Is running cp /root/.bashrc ~ Enough?

Last edited by AceOfSpade; 01-23-2011 at 11:18 PM.
 
Old 01-24-2011, 05:53 AM   #2
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
If it wasn't customized,
Code:
cp /etc/skel/.bashrc $HOME
.
 
Old 01-24-2011, 09:28 AM   #3
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
There is a file called /etc/bash.bashrc that you can use to restore the user bashrc file. No, it is not /etc/skel/bashrc in Ubuntu; that's for other distros.

This will restore your bashrc back to where it was. Log into a standard user account and type:

Code:
sudo cp /etc/bash.bashrc /root
This assumes you disrupted the root bashrc, which seems like so seeing as though it's /root/.bashrc.
 
  


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
[SOLVED] rpm spec file to overwrite my service script yaplej Programming 3 05-06-2010 11:52 AM
Help with script execution in bashrc globemast Linux - Newbie 4 11-07-2007 03:42 AM
safety script prevent accidental rm -rf GATTACA Programming 4 10-29-2007 02:36 AM
.bashrc script... wanderingkiwi Linux - General 1 01-31-2005 08:06 PM
trying to execute an expect script in .bashrc smaudlin Red Hat 2 01-02-2005 01:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:53 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
Open Source Consulting | Domain Registration