.bashrc a: find b: mount c set permissions d edit and remove

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chinagreen

.bashrc a: find b: mount c set permissions d edit and remove

Post by chinagreen »

Last nite I was trying to set a path . This resulted in fouling up my Linux Mint 8 install. I would like to edit the bashrc file using the start up cd of Linux Mint.

Here are my questions:
1. How do I locate the root version of bash rc?
2. Once I have located it, how do I mount the hard drive and set permissions in order to edit the file?
3. In addition to editing the bash rc file inside root, I also copied the same file to the home directory. How do I find this file and delete it?

I'd like to accomplish 1-3 above at the terminal. I am not familiar with the commands to perform these activities.
Thanks,
Bill
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
viking777

Re: .bashrc a: find b: mount c set permissions d edit and remove

Post by viking777 »

2)Easiest way is to click on the 'Computer' icon on the desktop then click on the file for your Mint 8 install in the file manager then make a note of the file path to your mint8 installation. I will assume that this is /mnt/mint8 but it will certainly not be so it is up to you to substitute the correct start to the path in all the following commands - do not copy and paste - it won't work.

1) In a normal install the path would be /root/.bashrc but as you are using a live cd it would be something like /mnt/mint8/root/.bashrc


3)

Code: Select all

sudo gedit /mnt/mint8/root/.bashrc
to edit and

Code: Select all

sudo rm /mnt/mint8/~/.bashrc
to remove the one from your home directory. NB in the second command there the character before the /.bashrc is meant to be a tilde (the wavy line situated above # on a UK keyboard). I mention that because it doesn't look like one on my preview).

One word of warning though. In the second command I am assuming that you overwrote your existing .bashrc in home with the one from the root directory. If you didn't do that and there are two there then you had better sort out which one you want to delete first.

Code: Select all

ls -a /mnt/mint8/~/ | grep bash

Would check if there is more than one version.
chinagreen

Re: .bashrc a: find b: mount c set permissions d edit and remove

Post by chinagreen »

Thanks for the help. I tried your suggestions. However, I was unsuccessful. My attempt can be found below.

Now, I have reinstalled Linux Mint.


mint@mint / $ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf8000000

Device Boot Start End Blocks Id System
/dev/sda1 1 10 80293+ de Dell Utility
/dev/sda2 * 11 40 240975 83 Linux
/dev/sda3 41 9729 77826892+ 5 Extended
/dev/sda5 41 601 4506201 82 Linux swap / Solaris
/dev/sda6 602 5083 36001633+ 83 Linux
/dev/sda7 5084 9729 37318963+ 83 Linux
mint@mint / $ sudo mkdir /media/sda6/
mint@mint / $ sudo mount /dev/sda6 /media/sda6
mint@mint / $ cd /media/sda6/etc
mint@mint /media/sda6/etc $ sudo gedit bash.bashrc
viking777

Re: .bashrc a: find b: mount c set permissions d edit and remove

Post by viking777 »

Well I am glad you got it sorted.

Just for future reference are you aware that .bashrc - as mentioned in the thread title, and bash.bashrc as mentioned in your last post, are two different files in two different locations?

This may have caused some confusion, I assumed you were talking about the first as that was in the thread title.
chinagreen

Re: .bashrc a: find b: mount c set permissions d edit and remove

Post by chinagreen »

Yes. You are correct. I was confused about the bashrc file. Thought I had it in memory, but I didn't.
Locked

Return to “Installation & Boot”