nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Editing a file in the Rescue mode shell

This is a discussion on Editing a file in the Rescue mode shell within the Linux software forums, part of the Linux Getting Started category; I made a small syntax error while adding some script to /usr/share/initramfs-tools/scripts/local. (This was to make the system boot in ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-01-2009, 01:08 AM
Junior Member
User
 
Join Date: Jan 2009
Location: Wichita Ks.
OS: Ubuntu
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dpeters is on a distinguished road
Default Editing a file in the Rescue mode shell

I made a small syntax error while adding some script to /usr/share/initramfs-tools/scripts/local. (This was to make the system boot in a degraded mode) Now the system will not boot.
So I booted from the CD and went into the Rescue Mode shell, did a cd to the appropriate directory, did a dir and there was my file "local". VIM was brought up and none of the keys work correctly due to the wrong terminal emulation. All I can do is start VIM and exit it. How does one change the emulation so VIM works correctly?
Reply With Quote
  #2 (permalink)  
Old 04-01-2009, 06:07 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

You are not using VIM. VIM is too big to load from rescue mode. You are using old good vi. To move keys use

Code:
   ** To move the cursor, press the h,j,k,l keys as indicated. **
             ^
             k              Hint:  The h key is at the left and moves left.
       < h       l >               The l key is at the right and moves right.
             j                     The j key looks like a down arrow.
             v
  1. Move the cursor around the screen until you are comfortable.

  2. Hold down the down key (j) until it repeats.
     Now you know how to move to the next lesson.
To insert press i

To save press w

To exit press q

Hope this helps. If you have access to another UNIX / Linux box see vi / vim tutorial, section moving keys.
Code:
vimtutor
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 13-01-2009, 12:59 AM
Junior Member
User
 
Join Date: Jan 2009
OS: Solaris
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
unixmen is on a distinguished road
Default use Vi

just use vi file
change or add some lines , then Esq :wq!


check the file with more file or cat .


Regards
www.unixmen.net team
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Shell Script To Outputs File Permissions of Most Recently Modified File glen_4455 Shell scripting 1 25-08-2008 02:39 PM
shell script to search specific file from txt file inside zip file and extract it aasif.shaikh Shell scripting 2 31-05-2008 06:44 PM
Real-Mode & Protected-Mode amsreeku Linux hardware 2 04-09-2007 09:02 PM
USB pen in Rescue mode in RHEL4 Rustem Linux software 1 20-12-2005 01:31 AM
Rescue mode in RHEL 4 Ashish Pathak Linux software 1 25-05-2005 07:27 PM


All times are GMT +5.5. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38