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.
You might want to look at a tutorial for vi, like this one.
Also, are you trying to edit that file as your normal user? If so, you'll probably get an error about the file being read-only (or something similar). So, try editing it as root (type su, followed by your root password and then execute as you did).
Location: Rhode Island within spitting distance of the water
Distribution: Mandriva Discovery 10.1
Thank you! No, I was doing the root thingy, having entered my password.
I went to the tutorial site you suggested and discovered that vi isn't what I want (I think?). That seems to start a whole new file, and I want to edit an existing file (I think?). By edit, I'm assuming I mean "add a line at the end to"--but I could be wrong about this, too. I've been wrong 9 times already today, so one more will hardly be noticed.
Perhaps you could tell me how to edit the pre-existing file.
Actually, I don't really use vi so am not sure. One suggestion though is to use nano or pico instead of vi, as they are really easy to use (at least, easier than vi). You probably have one or the other on your system and just run it the same way as with vi, eg. nano /etc/hosts.
You're not using a GUI right now then? If not, then type startx at the prompt to load the GUI. After that, open a terminal, change to root and then type "kate /etc/hosts" and edit the file. IIRC, kate is fairly intuitive (I don't have a Linux box right now so can't check). If you ARE using a GUI already (I assumed you were, cos you said you opened a terminal emulator) then just skip everything, except the last bit.
Do not worry about those error messages, they are of no consequence (but i wish someone would fix them!)
vi probably started on a new file for you because you typed "vi etc/hosts" and not "vi /etc/hosts" - there is a difference! You should probably learn a little vi because one day you will need it big time! Eg when you cannot get to the GUI and you are left with a text terminal only.
You only need to know about 4 vi commands:
The arrow keys move around the file.
i start Insert mode, so you can type/delete text
[ESC]:wq writes the file and quits
[ESC]:q! quits without making any changes
Practice on a simple (non-system) file until you are happy that you can do the basics.
Have fun with linux.