Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
To save and quit, all you have to do is ':wq' (omit the ticks). There are 2 modes in vi, one for editing (that you can access hitting the letter i) and a command mode (that you can access hitting semi-colon ().
If you can't manage, what distro are you using ? Perhaps you can install the pico or nano package instead of compiling...
You REALLY want to learn vi. It is on all systems by default and once you learn it, things are much easier than any other editor you may use (except for possibly emacs, but that is an operating system in my opinion (and no, I have never learned to use emacs)).
vi has three main modes, when you want to add text press i look at the bottom of the screen and it should say INSERT make the changes that you need then press Esc to exit instert mode, to save and quit press Ctrl and the collon at the same time. This will allow you to enter commands, type wq then enter to write/save and quit. Make sure you are root user if the file you need to edit needs root permissions.
Last edited by mrrangerman; 02-20-2008 at 02:30 PM.
Navigate to the nameserver entry with "j"
Type "yy" to yank a line into memory.
Type "p" to put a line from memory.
Hit "j" to go to the line you just put.
Hit "l" (Leter after "k" NOT number before "2") until you go to the first digit in the IP address.
Type "c$" to change the line from that point on.
Type the new IP.
Hit "Esc" key.
Save the file as you did before and exit vi.
is cargo-cult stuff, it's doing a write, then a quit. just use
means quit (ie exit-without-save)
is used when you want to save the current buffer to another filename (don't actually type the angle brackets)
If you want to use nano, then simply install it. You do need to learn the basics of using vi to be able to safely edit the sudoers file and the passwd file.
visudo is used to edit /etc/sudoers and uses "vim" but adds error checking. The program to edit /etc/passwd safely also uses "vim".
Also, the rescue mode or a rescue disk will have "vim" or "vim-minimal" installed but might not have nano.
There is a "sed" program that you probably will want to learn to use. It is based on the "ed" program which "vim" is based on as well. So if you learn to search and replace in "vim", you will also learn how to do it in "sed" as well.
FYI, you can also use cursor keys in vi. You don't have to use the j,k,l,m keys to navigate. Navigation keys are mostly useful combined with other commands such as :del or :yank. You don't need to learn them if you don't want to. Also the [insert] key will toggle between insert and replace modes as you would expect. You can also press the [Insert] key to quickly get into the edit mode when you start.