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.
vi allows you to work with multiple files at a time. You can do this at the start by typing vi file1 file2 file3. You switch between files using :n for next. It also allows you to open another file on the fly by first saving the current file we'll say filea with :w and then using :e fileb to open another file. vi remembers two filenames current % and alternate #. To get back to filea when you are done with fileb you save fileb :w and then type the command :e#.
The way you can save buffers to another file is by opening another file in vi and then copying the buffer to the new file. For example, I open fileabc, perform some edits, and yank part of it to buffer a. After saving fileabc with :w, I open filexyz with the command :e filexyz. (Note: you must save the current file before switching to another file) The buffers remain intact because we never closed vi. So at this point you can use :pu a to put the contents of buffer a into filexyz after the cursor. Save filexyz with :w and then you can switch back to the other file using :e#.
thanks for the response, it cleared up several things for me.
editing an working in vi definitely gets faster and easier the more you work with it, i can only hope the opening/editing of multiple files does likewise. so far i have found that the vi method stinks, i don't like it. why we can't just save a buffer to a new file escapes me and really crimps my style. but the way i figure, if you're doing something in vi and it's not easy then most likely you're not doing it the right way... so it's probably just me....
Yes, very true about vi. When I first used it I thought what a cryptic and nasty way to edit a file. However, if you take the time to learn it you can move around very fast and it becomes second nature. Think about all the time used by taking your hand off the keyboard to move your mouse and then bringing your hand back to the keyboard. To understand vi's development you have to look back to when keyboards did not have arrow keys or a number pad. They had to move around some way. vi was a breakthrough compared to ex or edlin the old DOS editor.
yep, the operative words being, "if you take the time to learn it." i had been using vi for a while but didn't really take the time to learn the mnemonic combinations, the delete and arrow keys worked while in insert mode so i just used those. it was only after i made a concerted attempt to learn the h,j,k,l, ^, etc., keys properly did things really get going. it took a while, but now i actually prefer it and think it is faster than with a mouse.
i am close to being able to totally dump kedit, if i could more adequately solve the buffers issue then i would... the open/close methods given by wmakowski work fine for most situations, however, like yanking a chunk from one file and inserting it into another, it's only when trying to save a named buffer as a new file does the sequence seem convoluted, and even then it is still workable. so i say, hooray vi!!
Last edited by frostillicus; 04-19-2005 at 01:08 PM.