Others > Miscellaneous

Help for command line editing..


Hey.. I was running every thing. fine.. untill i had formatted one of my linux drive with reiserfs .. but i forgot to change the entries in fstab.

So now system refuses to boot..
can any one tell me how I can change the lines in fstab using command line..

or using  vi editor.
i can open that file.      vi /etc/fstab but unable to edit or save as i m not familier with command line editing in linux..

simply I wanna know that how can i edit a file in command line??

help is appreciated..

to edit your fstab u can start linux recovery and ...
on the command line..
--- Code: ---vi /etc/fstab
--- End code ---
it will start fstab.

Now press insert button so that u can do modifications in fstab.

Now at command prompt..

--- Code: ---:save fstab
--- End code ---

Is that wht u want?

use ur cd to linux rescue or use ur bootloader to go into the shell
if u use the cdrom type the command
--- Code: --- chroot /mnt/sysimage

--- End code ---

now u may do comand line editing by using vi or emacs as the case may be ur file is in /etc/fstab.

If u do mean vi then i do like this in Red Hat distro:

1) "Insert" key to enable u to type in the file u wish to edit. Then start typing :)

2) Now, press "Esc" if u finish typing.

3) Type ":" followed by "w" to save. ----> ":w"

4) Press "Esc" again and type ":" followed by "q!" to quit without saving. ----->":q"

Just press "Shift" + "zz"  (zz = press "z" twice) to save and quit vi.


[0] Message Index

Go to full version