Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Others => Miscellaneous => Topic started by: indigo on November 03, 2003, 06:56:20 PM

Title: Help for command line editing..
Post by: indigo on November 03, 2003, 06:56:20 PM
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..
Title: Help for command line editing..
Post by: Ricky on November 04, 2003, 05:52:31 PM
to edit your fstab u can start linux recovery and ...
on the command line..
Code: [Select]
vi /etc/fstabit will start fstab.

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

Now at command prompt..
Code: [Select]
:save fstab
Is that wht u want?
Title: Help for command line editing..
Post by: neo on November 10, 2003, 04:38:01 PM
use ur cd to linux rescue or use ur bootloader to go into the shell
if u use the cdrom type the command
Code: [Select]
chroot /mnt/sysimage

now u may do comand line editing by using vi or emacs as the case may be ur file is in /etc/fstab.
Title: Help for command line editing..
Post by: dragoncity99 on February 11, 2004, 03:38:30 PM
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"
   
      OR

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