In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How do I save and exit after linux edits the file?
The command is wq to save and exit.
First press ESC to enter Command mode, then type ": wq", and enter to save and exit.
Vi has different options for saving files. Corresponding to different commands, you can select a desired input from the following command:
1. Wq saves the file and exits vi
2. W Save the file but do not exit vi
3. W file saves the changes to file and does not exit vi
4. Q quit vi without saving the file
Finally, you can enter the car.
Extended data
Exit Vi when you are ready to exit Vi and return to shell after editing the file, you can use one of the following methods to press the capital letter Z twice in command mode. If the currently edited file has been modified, Vi saves the file and then exits to return to shell.
If the current edited file has not been modified, Vi directly exits and returns to shell to enter the command in the last line mode: W Vi saves the current editing file but does not quit but continues to wait for the user to enter the command to give the editing file a new file name when using the w command.
Linux is a free-to-use and free-spread Unix-like operating system. It is a multi-user, multi-task, multi-threaded and multi-CPU operating system based on POSIX and UNIX. It runs major UNIX tools, applications, and network protocols. It supports 32 bit and 64 bit hardware. Linux inherits the design idea of Unix with network as the core, and is a multi-user network operating system with stable performance.
Strictly speaking, the word Linux itself only refers to the Linux kernel, but in fact people have become accustomed to using Linux to describe the entire Linux kernel and use GNU to project operating systems with various tools and databases.
Supplementary content:
For example, to add the content "I am a boy" to the test.txt file, test.txt is in the current directory
Method 1: vi editing method
Open the terminal, enter vi test.txt enter, press an or I to enter edit mode, enter I am a boy, then press ESC to exit editing mode, enter: wq to save and exit.
Method 2: echo command method
Open the terminal and enter
Echo'I am a boy' > >. / test.txt
Note: additional single-line text method
Method 3: cat command method
Cat > >. / test.txt. / test.txt (enter and start editing the input)
I am a boy.
Press cntl+d to end editing.
So far, this is the end of this article on the practical explanation of saving and exiting linux editing files. Please search for previous articles or continue to browse the relevant articles below after you save the exit content after editing the linux file. I hope you will support it in the future!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.