Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
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:
|
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.
|
|
|
09-18-2005, 02:45 AM
|
#2
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
How about plain old "vi".
|
|
|
09-18-2005, 04:18 AM
|
#3
|
LQ Newbie
Registered: Jul 2005
Distribution: Ubuntu
Posts: 3
Rep:
|
OR nano login and enter 'sudo nano'
|
|
|
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
|
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.
|
|
|
All times are GMT -5. The time now is 04:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|