zoukankan      html  css  js  c++  java
  • Linux常用基本命令(less)

    转;

    Linux常用基本命令(less)

    LESS:跟more命令的功能类似,都是用于分页显示内容,但是他的性能比more更高,功能比more更丰富,他读取文件是按需加载

    格式:

    less [option] [file]

    -N : 显示每行的行号 类似cat命令的-n

    -s: 将连续的空行显示为一行

    交互子命令:

    b: 向前翻一页

    空格键:向后翻一页

    u:向前翻半屏

    d:向后翻半屏

    y:向上滚动一行

    回车键:向下滚动一行

    /字符串 向下搜索字符串

    ?字符串 向上搜索字符串

    n 向后查找下一个匹配的文本

    N 向前查找前一个匹配的文本 

    G:移动到最后一行 

    g:移动到第一行

    h:显示帮助页面

    q:退出less命令

    ghostwu@dev:~/linux/more$ ls /etc | less -N

    在交互模式下,用h显示帮助页面,可以查看less命令详细用法

    复制代码
    1 
          2                    SUMMARY OF LESS COMMANDS
          3 
          4       Commands marked with * may be preceded by a number, N.
          5       Notes in parentheses indicate the behavior if N is given.
          6       A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-      6 K.
          7 
          8   h  H                 Display this help.
          9   q  :q  Q  :Q  ZZ     Exit.
         10  -----------------------------------------------------------------------     10 ----
         11 
         12                            MOVING
         13 
         14   e  ^E  j  ^N  CR  *  Forward  one line   (or N lines).
         15   y  ^Y  k  ^K  ^P  *  Backward one line   (or N lines).
         16   f  ^F  ^V  SPACE  *  Forward  one window (or N lines).
         17   b  ^B  ESC-v      *  Backward one window (or N lines).
         18   z                 *  Forward  one window (and set window to N).
         19   w                 *  Backward one window (and set window to N)
    复制代码
    作者:ghostwu, 出处:http://www.cnblogs.com/ghostwu 博客大多数文章均属原创,欢迎转载,且在文章页面明显位置给出原文连接
  • 相关阅读:
    Python学习笔记5
    Python字符串的encode与decode
    python代码`if not x:` 和`if x is not None:`和`if not x is None:`
    关于sys.argv
    Python学习笔记4
    Python学习笔记3
    Python学习笔记2
    生产者消费者_测试
    进程管理
    软件包管理
  • 原文地址:https://www.cnblogs.com/libin6505/p/10675758.html
Copyright © 2011-2022 走看看