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!
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.
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.
Well, that all depends on which editor you're using.
Since I generally use emacs when at the command, I'll explain that (although these are all in docs elsewhere... such as TLDP).
You start editing the file by typing emacs filename. You move around the file with the arrow keys. You edit by, erm, editing. Just delete and type. You exit by typing <CTRL>+<x> and then <CTRL>+<c>. Note that these are small x and small c. You will then be prompted as to whether you want to save the file before exiting (down on the bottom line of the screen). Just press y and then hit <enter>. You should now be back at the prompt. Viola, you've just edited your first file.
Many people prefer to use vi because of its low overheads and the fact that once you've become used to the way of issuing commands (and such), you can do all your business remarkably quickly. Personally, I'm a creature comforts kinda-guy, so I don't like to make things to difficult on myself.
There has been many a flamewar over vi/emacs, and I don't intend on starting one here. I hope that anyone else who is inclind to give a quick tutorial on basic editing with their favourite editor (although it seems that most are fairly similar) does so.
I like vi although I don't really have a good reason, I just use it.
to use #vi file
once in vi press "a" to insert text after the cursor, once you have what edited the file, press the 'esc' key and then type ":wq!" to write the file and exit.
And I prefer vi for its simplicity sort of, to save and quit just press Esc and then Shift-Z-Z (meaning press z letter twice while holding shift key), it is much quicker than typing :wq
As was previously noted, it depends on your choice of editor. And you do have a choice, just like anything else in Linux.
If you are not a UNIX/LINUX administrator, then choose an editor that suits you. My personal favorite is jed (and its X counterpart, xjed). It doesn't require a whole lot of remembering, since it has a "tool" bar of function keys as reminders. Nothing against vi, it just strains my brain, since I am not an admin (except my own desktop replacement lappy) and don't very often edit system files, data files, or other text files from the command line.
I've learned "barebones" vi, and can get by, but it is not my fave. I've tried joe, and it's not bad, but it requires remembering keystroke combinations that literally go back to DOS level file editors and to Wordstar. And there are others like ed, ted, and others.
Note the complete lack of mention of the editor that comes with its own operating system (close enuff anyway!!). As a simple text editor, forget EMACS.
I didn't say you have to use it for your personal favorite, I just mentioned its good to know for those emergency situations when its the only editor available
I just personally prefer it cause to me its fast and easy to use, once you get use to it.
But yeah, there are so many editors out there. Might as well use pico though so Acid doesn't get mad at your for not using it..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.