【Linux入門】viコマンドの基本的な使い方【viエディタとあわせて解説します】 KOMODiary from komodblog.com
Introduction
If you are someone who works with Linux or Unix, then you must have heard of the Vi command. Vi is a text editor that has been around for decades and is still widely used today. If you are new to Vi, it can be a little intimidating at first. However, once you get the hang of it, you will find that it is a powerful tool that can make your work much easier. In this article, we will cover the basics of Vi and how to use it effectively.
What is Vi Command?
Vi is a text editor that is used in Unix and Linux operating systems. It is a command-line tool that allows you to create and edit text files. Vi is a modal editor, which means that it has different modes for different tasks. The two main modes of Vi are the command mode and the insert mode. In the command mode, you can issue commands and navigate the text. In the insert mode, you can insert and edit text.
Starting Vi Command
To start Vi, you need to open a terminal window and type "vi" followed by the name of the file you want to edit. If the file does not exist, Vi will create a new file with that name. Once Vi is open, you will see the command prompt at the bottom of the screen.
The Command Mode
The command mode is where you issue commands to Vi. To enter the command mode, press the "Esc" key. In the command mode, you can move the cursor around the screen using the arrow keys. You can also issue commands by typing them at the command prompt.
The Insert Mode
The insert mode is where you can insert and edit text. To enter the insert mode, press the "i" key. Once you are in the insert mode, you can start typing. To return to the command mode, press the "Esc" key.
Moving the Cursor
To move the cursor around the screen, you can use the arrow keys. You can also use the "h", "j", "k", and "l" keys to move the cursor left, down, up, and right respectively.
Deleting Text
To delete text, you need to be in the command mode. You can delete a single character by moving the cursor to the character and pressing the "x" key. To delete a whole word, move the cursor to the beginning of the word and press the "dw" keys.
Copying and Pasting Text
To copy text, you need to be in the command mode. Move the cursor to the beginning of the text you want to copy and press the "y" key. Move the cursor to the end of the text and press the "p" key to paste the text.
Saving and Quitting Vi
To save changes to a file, press the "Esc" key to enter the command mode. Type ":w" followed by the name of the file to save the changes. To quit Vi, type ":q". If you have made changes to the file and want to save them before quitting, type ":wq".
Conclusion
The Vi command is a powerful tool that can make your work much easier. While it may seem intimidating at first, with practice, you will find that it is a valuable skill to have. In this article, we covered the basics of Vi, including starting Vi, the command mode, the insert mode, moving the cursor, deleting text, copying and pasting text, and saving and quitting Vi. With these skills, you will be able to use Vi effectively in your work.
0 Response to "List Of Vi コマンド 使い方 Ideas"
Posting Komentar