[SOLVED] Replaced my .bashrc file with a bash file

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
parotta36

[SOLVED] Replaced my .bashrc file with a bash file

Post by parotta36 »

I accidentally replaced my .bashrc file with a bash file. How am i supposed to bring my .bashrc file back?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Replaced my .bashrc file with a bash file

Post by rene »

A default/vanilla .bashrc you can (on Mint 18) copy over from /etc/skel/.bashrc; that's where it's got from for every new user account. If you changed it and have now overwritten it, the easiest course of action is probably to change it again after doing the former.
lmuserx4849

Re: Replaced my .bashrc file with a bash file

Post by lmuserx4849 »

parotta36 has the solution. A usage tip: Before you make a change to any configuration installation file, make a backup. If it is a new file that has never been modified, add the suffix "install", after that make the suffix the date time. Not only will you have a recent backup, but you can use diff to see what has changed.

Code: Select all

cp -a .bashrc .bashrc.install  
cp -a .bashrc .bashrc.$(date +%Y%m%dT%H%M%S)
diff -y .bashrc .bashrc.install 
parotta36

Re: Replaced my .bashrc file with a bash file

Post by parotta36 »

Thank you all, I have restored the file.
User avatar
BG405
Level 9
Level 9
Posts: 2508
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: Replaced my .bashrc file with a bash file

Post by BG405 »

This thread may be very helpful to others :) would be great if you add [SOLVED] to the beginning of the title of your first post, as this will help people searching for a solution. Thanks!
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
Locked

Return to “Scripts & Bash”