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.
There's no dns ip entered. I can't connect to domains. Only connect them from their ip's. (I could connect, but i rebooted the computer and after i started to can't connect domains.)
I'm trying to edit the "/etc/resolv.conf" file for dns, but it's really hard to edit it with "vi" editor. I can't find how to save it with "vi" :S
Nano gives error when typed "make" after "./configure"
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 01: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.
Actually,
:wq
is cargo-cult stuff, it's doing a write, then a quit. just use
:x
means exit-with-save
:q
means quit (ie exit-without-save)
:w <filename>
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.
Personally I'm nearly always on X-windows, so I cheat and use the mouse and /or ctrl-c/ctrl-v to copy and paste, but on a console you need the old yank/put combo.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.