Click to See Complete Forum and Search --> : Dropped to shell
WaveSurfer
06-18-2001, 02:08 AM
I altered my.bashrc on the advice of a guru. All worked well until I had to reinstall and when re-altering .bashrc I made a typo or 2.
So now I cant get to KDE. In one of my trusty Linux books it mentions a text editor called VI I dont have VI but have VIM. Because my book only mentions in passing VIM I dont have the commands. I have brought up .bashrc and changed the errors. But I cant save the new file. Ive typed everything I can think of.... not happening. I see there is a web site for VIM but if someone could save me alot of time and just tell me how to save a file under VIM I would be really really grateful.
Thanks in advance. :cool:
Craig McPherson
06-18-2001, 03:34 AM
vim is fully compatible with vi, but with a ton of extra features added.
To save and exit in any flavour of vi, you press the ESCAPE key to make sure you're in command mode, then you type :wq and press enter.
Sidenote: you may have the original vi editor on your system under the name nvi, but I think only a masochist would use it when vim or elvis is available.
WaveSurfer
06-18-2001, 08:45 AM
I tried esc :wq enter and esc x but I got a "read only option is set (use ! to override) so I tried ! and every other comination of ! but still couldnt use any of the save commands. Must have to reset things first right ??!! :(
X_console
06-18-2001, 11:41 AM
First make sure that you're root when you're editing a system file, or that you have permissions to edit the file. That said, you should be able to save with:
ESC
:!wq
WaveSurfer
06-19-2001, 05:35 AM
Thanks for the posts. I am in root when I do this. After esc I typed :!wq enter the reply was:
[no write since last change]
/bin bash : wq : command not found.
shell returned 127
Im not too sure about the permissions but command not found doesnt look like permissions. Hope you can help.
Craig McPherson
06-19-2001, 06:25 AM
You use the :wq command inside of vim, to save the file you're working on and exit. It's not a shell command.
bdg1983
06-19-2001, 06:35 AM
I would suggest you have a look through the Vi Crash Course (http://www.linuxnewbie.org/nhf/intel/tools/vicc.html) NHF.
WaveSurfer
06-20-2001, 03:51 AM
Hi,
I read the VI crash course. My problem is with permissions. I treid to change them using chmod 744 .bashrc and was told its a read only file. Now Im in root already and I cant change the permissions. My book says I should be able to. What do I do now ??
X_console
06-20-2001, 11:32 AM
Sorry, it should be:
ESC
:wq!
not :!wq
slayer17
06-20-2001, 03:43 PM
All I am going to say is that YOU need to learn vi! If you systems is destroyed and you need to do real work, vi is all you will normally have. It is the one aspect of unix that is a must! VI VI VI VI VI VI!
WaveSurfer
06-20-2001, 08:47 PM
I hate to be a pain but Ive even to a newbie like myself the problem is permissions. Ive read the VI crash course and it tells me over and over that the file is read only.
I try to change permissions in root and again it tells me that it is a read only file system. Now Ive read up on file permissions and its the same thing go to root and type out the command no too hard !! Now where does it mention what to do if when you are in root and the system says its read only what to do. I hope you see my problem. Something else is wrong or Im seriously missing something but Ive done this by the manual and have hit a wall.
What could I have missed?? What should I check ?? :confused:
Linuxcool
06-21-2001, 12:13 AM
OK. Let me see if I got this. You log in as root. You cd into the directory where the file is located and run the command ' chmod 744 .bashrc ' and you get an error about a file being read only file. Could you post the exact error message?
WaveSurfer
06-21-2001, 09:09 AM
Ok here it is :
root@localhost /root# chmod 744 .bashrc
chmod: .bashrc: Read only file system
In vim it also tells me the file is read only. Now all the books say that as root it should do as its told and become writable but this is what I get and nothing in anything Ive read mentions this problem.
Thanks
demian
06-21-2001, 09:26 AM
Ahh, your / filesystem is mounted read-only (that's good btw cause it prevents it from getting corrupted). Try to remount it rw via
mount -o remount,rw /
then save the file and remount the filesystem read-only.