Use Vi to create, edit, and save files-general Linux technology-Linux programming and kernel information. For more information, see the following. Today, I installed RedHat linux on the vmwarevm. Only after I used it, I found that there are many differences between RedHat and ubuntu. For example, the first problem I encountered was that I could not directly create files under RedHat, you can easily right-click ubuntu.
So how to create files in RedHat? Do not forget the powerful editing tool Vi provided by linux.
Enter:
Vi/path/file name
For example:
Vi/usr/local/a. c
If. c, open. c. If. c, then an empty file a will be created directly in this path. c. We can use the PageUp and PageDown keys to turn pages up and down. Press the Insert key and we will find "Insert" in the lower left corner of the window, which is in the editing status, at this time, we can write content to the file through the keyboard; if you press the Insert key, "replace" appears in the lower left corner, which is to replace the editing status, at this time, the content entered at the cursor will replace the content of the file. After editing, Press Esc and enter ": wq". Then press enter to save and exit. If you do not want to save and exit, Press Esc and enter ": q! ", Which indicates forced exit.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service