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

目的: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--


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值