Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Linux and Vim

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you how to use Linux and Vim. The content is simple and easy to understand. It is clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn how to use Linux and Vim.

Linux is a set of free to use and freely spread Unix-like operating system, is a POSIX and UNIX-based multi-user, multi-task, multi-threaded and multi-CPU support operating system. It runs major UNIX tools, applications, and network protocols. It supports both 32-bit and 64-bit hardware. Linux inherits Unix's network-centric design idea and is a stable multi-user network operating system.

Linux system distributions

Redhat

Ubuntu

CentOS

Fedora

Debian

openSUSE

For Linux installation, you can choose Ubuntu or CentOS 7.

For virtual machine installation, first install VMware or Vbox, and then go to the official website to download iso image, import iso image file, set the corresponding network configuration and memory configuration, corresponding to its specific operation, Baidu search.

Linux common commands

Vim

VIM (text editor for Unix and Unix-like systems)

Vim is a well-known powerful, highly customizable text editor similar to Vi, which improves and adds many features to Vi.

"Focus."

In Vim, there are three modes: command mode, input mode and last line mode.

Press ESC to enter command mode

Enter Shift + ; to enter Last Line Mode

Enter insert commands such as (i,a,o) to enter insert mode

Note that the premise of entering the last line mode must be command mode, that is, after entering the command, you must first return to command mode.

Enter vim filename

exit

:wq last line mode, wq save exit

:q End line mode, q directly exit

:q! Last row pattern, q! Forced exit, do not save

move the cursor

gg to first line of file

G to the last line of the file (Shift + g)

^Non-blank line headers

0 line first (digit 0)

$End of line

input mode

i Insert from the front of the cursor

I Insert at the beginning of the current line

a Start typing from behind the cursor.

A Insert at the end of the current line

o Add a line below the cursor line and enter input mode

O Insert one line above the current

After entering the input mode, the word--INSERT-appears on the last line

These commands are copy and paste in command mode (must be used flexibly)

yy Copy entire row content

3yy Copy 3 lines

yw Copy current cursor to end of word content

p-paste

delete

dd Delete cursor row

dw Delete a word

x Delete cursor character

u Undo last operation

Ctrl + R Undo U

block operations

v block selection

Ctrl + v column block selection

find

/Enter in Command Mode: /Search Forward

? Enter in Command Mode: ? back search

nLook down

N search up

replace last row pattern

:s/s1/s2 Replace the first s1 in the current row with s2

:s/s1/s2/g Replace all s1 in the current row with s2

:%s/s1/s2/g replaces all s1 in the text with s2

The key to Vim's operation is to practice more

Finally, I attached a summary of Vim keyboard operation:

That's all for "How to use Linux and Vim". Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report