November 21, 2024, 05:38:34 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Help for command line editing..  (Read 11162 times)

Offline indigo

  • Linux Noob !
  • *
  • Posts: 16
Help for command line editing..
« 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..

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Help for command line editing..
« Reply #1 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?

Offline neo

  • Linux Learner
  • ***
  • Posts: 125
    • http://www.investorsgain.com
Help for command line editing..
« Reply #2 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.

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Help for command line editing..
« Reply #3 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.