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.
I'm having trouble figuring out how to save changes inside files opened in the terminal.
Specifically, I am trying to add "ServerName localhost" to my apache2.conf file, but I don't know how to save things in the terminal.
I found a solution on this site that said to hit escape then type :wq then hit enter, but that did not work. It gave me an error message that said the command was not recognized, and my wq showed up as text in the file alongside "localhost" indicating that it was not actually executing it as a command.
Anything I am missing here? Thanks for any help! I am using Linux for the first time to make a website using html/css/php/sql/java for my senior project (I am in highschool) so any bit of information would be much appreciated!
Which editor are you using to modify the file? ":wq" is specifically for vi/vim, so if you're using a different editor, that won't work.
I'm not actually sure, I am using whatever the default is when I run the command "$ sudo nano /etc/apache2/apache2.conf" in the terminal. The terminal then changes into a new terminal window, with some information on it. The top says: GNU nano 2.2.6 File: /etc/apache2/apache2.conf -that is all I know.
It means you are using nano console text editor. For saving you have to press keys CTRL-x simultaneouly or one after another quickly. It will show dialog for filename or path with filename to save there.
It means you are using nano console text editor. For saving you have to press keys CTRL-x simultaneouly or one after another quickly. It will show dialog for filename or path with filename to save there.
It worked, thank you so much for helping me!
Now I also know what sudo means and that it is a console text editor. I will use this as a learning experience so I won't need to ask a question like this again.
No. Nano is the text editor. sudo is used to give you elevated privileges - with your regular user account, you can't edit files in /etc, so you use sudo to let you run nano with privileges that allow you to modify the file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.