您的位置:首页 > 其它

问题1:如何在vi编辑器中,显示行号

2014-09-01 10:38 399 查看
目的:linux 环境下,vi 编辑器中显示行号

1. 利用vi 命令打开一个文件:

$ vi oratab

2.在命令行模式下, 输入“冒号 + set nu” 命令,点击回车,就可以显示每行的行号

:set nu

操作过程:

/***********************************************************************/

#

# This file is used by ORACLE utilities. It is created by root.sh

# and updated by the Database Configuration Assistant when creating

# a database.

# A colon, ':', is used as the field terminator. A new line terminates

# the entry. Lines beginning with a pound sign, '#', are comments.

#

# Entries are of the form:

# $ORACLE_SID:$ORACLE_HOME:<N|Y>:

#

# The first and second fields are the system identifier and home

# directory of the database respectively. The third filed indicates

# to the dbstart utility that the database should , "Y", or should not,

# "N", be brought up at system boot time.

#

# Multiple entries with the same $ORACLE_SID are not allowed.

#

#

radius:/home/oracle/app/oracle/product/10g:Y

~

~

:set nu

/***********************************************************************/

或者

在编辑模式下,敲击键盘上的"Esc"键回到命令行模式,输入“冒号 + set nu” 命令,点击回车,也可以显示每行的行号

返回结果如下:

/***********************************************************************/

1 #

2

3

4

5 # This file is used by ORACLE utilities. It is created by root.sh

6 # and updated by the Database Configuration Assistant when creating

7 # a database.

8

9 # A colon, ':', is used as the field terminator. A new line terminates

10 # the entry. Lines beginning with a pound sign, '#', are comments.

11 #

12 # Entries are of the form:

13 # $ORACLE_SID:$ORACLE_HOME:<N|Y>:

14 #

15 # The first and second fields are the system identifier and home

16 # directory of the database respectively. The third filed indicates

17 # to the dbstart utility that the database should , "Y", or should not,

18 # "N", be brought up at system boot time.

19 #

20 # Multiple entries with the same $ORACLE_SID are not allowed.

21 #

22 #

23 radius:/home/oracle/app/oracle/product/10g:Y

/***********************************************************************/

--END--
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: