[SOLVED] I put an 'exit' in my /etc/bashrc and now can't open a terminal or modify!
Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I put an 'exit' in my /etc/bashrc and now can't open a terminal or modify!
This was a very bad move, but I put an exit in my /etc/bashrc file and now I can not open a new terminal or modify the file. I can't su and their are no users in the sudoers file. Please let me know if you have any ideas. TIA
Idea #1: Try using your `run command` dialog box (should be something like this in your menus somewhere) and starting your terminal manually, giving the command with /bin/bash and the --norc and/or --noprofile option to tell it to ignore the broken file(s).
Something like below in your run dialog:
gnome-terminal -c /bin/bash --norc --noprofile
You didn't tell us what OS you're running; I'm guessing Ubuntu or RHEL, but depending what OS it is, you'll want to specify whatever terminal program you normally use.
Idea #2: Ubuntu has Dash shell installed. You could reboot and edit your kernel boot line to include init=/bin/dash which should boot you to a minimal environment shell prompt, from where you could repair the file.
NOTE: There might be an easier idea(s) but this is what comes to mind.
Last edited by GrapefruiTgirl; 08-19-2010 at 09:13 AM.
If you know your error, you should also be able to re-edit the file that is causing your misery using a linux live-cd, one that will give you "root"(read/write) privileges. PCLinuxOS with KDE is a suggestion, but there are others with Gnome if that is more familiar to you.
You may have to boot into "guest" and change the log-in to "root" thereafter, as is the case with PCLinuxOS.
Last edited by thorkelljarl; 08-19-2010 at 09:24 AM.