ubuntu less分页查看log文件

less命令查看 log 文件
less  file.log  (打开了文件从第一行开始,若想移到最后一行 shift+g ctrl+b往前一页一页翻页查看)
j - 向前移动一行
k - 向后移动一行
G - 移动到最后一行
g - 移动到第一行
ctrl + F - 向前移动一屏
ctrl + B - 向后移动一屏

q / ZZ - 退出 less 命令

模仿 tail -f          Press F

向下10行 10j – 10

向上10行 10k 

  • CTRL+G – show the current file name along with line, byte and percentage statistics.
  • Less Command – Multiple file paging

    Method 1: You can open multiple files by passing the file names as arguments.

    $ less file1 file2

    Method 2: While you are viewing file1, use :e to open the file2 as shown below.

    $ less file1
    :e file2

    Navigation across files: When you opened more than two files ( for e.g – less * ), use the following keys to navigate between files.

    • :n – go to the next file.
    • :p – go to the previous file.

示例

查看命令历史使用记录并通过less分页显示

命令:

 history | less


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值