小编ned*_*dim的帖子

如何配置“less”从终端窗口顶部开始打印?

我最近从 Ubuntu 15.04 切换到 15.10,尽管它们似乎具有相同版本的less458,但我得到了不同的行为。

在我的新系统中,如果文件的行数少于终端,则将less其显示在终端窗口的底部,如下所示:

                          <-
                          <- empty space, not part of file
                          <-
file starts here
  ...
last line of the file
(END) <- symbol inserted by LESS
Run Code Online (Sandbox Code Playgroud)

根据我对其他系统的经验,我会得到以下行为:

file starts here
  ...
last line of the file
(END) <- symbol inserted by LESS
                          <-
                          <- empty space
                          <-
Run Code Online (Sandbox Code Playgroud)

这是一个小问题,但仍然很重要。新行为的问题是,我无法从输出中判断文件是否实际上以空行开头,或者只是less输出它的方式,因为它对于终端窗口来说太短了。

less

4
推荐指数
1
解决办法
637
查看次数

标签 统计

less ×1