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 add line number in Linux system vi

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the Linux system vi how to add line numbers, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Method 1: 1. Display the current line number and enter it in VI command mode

: nu

2. Display all line numbers and enter them in VI command mode

: set nu

Method 2: edit the ~ / .vimrc file using vi, add a line "set nu" to the file, and add the content without quotation marks. The command is as follows:

Maybe this file doesn't exist, just create a new one and add set nu to it.

Method 3: the configuration file of vi in UBUNTU is stored in the / etc/vim directory, the configuration file named vimrc vi in Fedora is stored in the / etc directory, and the configuration file is named vimrc

Edit the file using vi and add a line set nu to the file

Thank you for reading this article carefully. I hope the article "how to add a line number in Linux system vi" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Development

Wechat

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

12
Report