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.
After launching vi, writing some text and attempting to save it I get the error message "Can't open file for writing." Since I did not open a file to begin with don't know what this is in reference to. Does one have to specify the filename before trying to save it? That is issue the command vi <filename> first? The method that I tried to save the file is as follows:
1:Go into command mode using the Esc key
2:Then issue the :w command followed by the filename and pressing the Enter key.
3: What follows is the noted error message or the option of continuing with the command. This implies that the command is incomplete. Pressing the Tab/Ctrl keys for some hints does not help and I could not see any infomation in the Man pages on this. TIA for suggestions on resolving this issue.
I tried the :wq command followed by the filename and still get the same error message. When I try to specify a path after the filename I get the message that only one name is allowed per file. Don't know what, if anything, I may be doing wrong unless someone has overlooked something. I wonder whether or not the filename should precede the :wq command?
When you first open vi you should state the name of the file you would like to save it as. For example: #vi howtousevi# would be opening a new file and naming it "howtousevi". Then at the end when you try to save with :wq it will simply right over the empty file named "howtousevi". I don't know if this will help or not, but good luck.
It seems that it says "can't open file for writing" when you don't have write access to the place it's trying to write it to.
However, if you simply type
:w /home/username/filename" it should work.
What version of VI are you using?