Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 09-16-2005, 10:11 PM   #1
LQ Newbie
Registered: Dec 2004
Location: Philippines
Distribution: Slackware v10.1 and Ubuntu v5.04
Posts: 27

Rep: Reputation: 15
text editor in rescue mode?

what text editor may be used in rescue mode. i am trying to edit "fstab" - this after changes in the physical setup of hard and optical drives messed up my ubuntu installation. tried invoking nano but the shell gave me this: "Error opening terminal: bterm." vim, on the other, would not give me the insert mode. thanks in advance.

Last edited by abtimoteo; 09-16-2005 at 10:21 PM.
Old 09-18-2005, 02:45 AM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
How about plain old "vi".
Old 09-18-2005, 04:18 AM   #3
LQ Newbie
Registered: Jul 2005
Distribution: Ubuntu
Posts: 3

Rep: Reputation: 0
OR nano login and enter 'sudo nano'
Old 09-18-2005, 08:58 AM   #4
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Not sure what you mean by rescue mode.

vim is an enhance vi like editor. If your session vi/vim while you were editing the file you just need to use the "-r" flag to tell it to recover the last session. vi/vim actually makes a copy of the file you're editing and does its work on that until you issue the :w (or :wq or either with ! or shift ZZ etc... - i.e. you tell it to save).

The above default functionality allows for rescue from crashed/improperly terminated editing session because your original file was never changed.

If what you mean is you want to be able to recover a file from before you made the changes that you saved then you simply should copy the file before you start the edit. This isn't Windoze so you're not going to be asked if you're really really sure before it does what you tell it.

Typically for most files I do "cp -p file file.datestamp" before I do the edit. The file of course is whatever file (fstab for example) and the datestamp is today's date (20050918 for example). The "-p" tells it to preserve permissions and modify times so the file is exactly the same as the original (except its on a different inode but that only matters rarely for weird key files). If you later need to recover you simply do "cp -p file.datestamp file" to overwrite the one you mucked up.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
How could I go into Rescue Mode??? unixfreak Linux - Newbie 20 08-24-2004 09:19 PM
about rescue mode morrisset Linux - Newbie 3 07-10-2004 11:11 AM
Text Mode Editor: What Choices? BASH, VI, EMACS? LinxAI Linux - Newbie 12 03-28-2004 11:17 PM
Text Editor in Console Mode ? membrax Linux - Hardware 5 12-28-2002 11:14 PM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration