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

    more命令

    作用:相比cat一次性显示文件内容,more用于分页显示内容,less比more更强大,大多数的参数类似

    more [option] [file]

    -num : 每页显示num行

    +num: 指定从num行开始

    -s: 把连续的多个空行显示为一行

    ghostwu@dev:~/linux/more$ cat -n ghostwu.txt 
         1    this is ghostwu
         2    
         3    
         4    how are you
         5    
         6    
         7    file thank you
         8    file thank you
         9    file thank you
        10    file thank you
        11    file thank you
        12    file thank you
        13    file thank you
        14    file thank you
        15    file thank you
        16    file thank you
        17    file thank you
        18    
        19    
        20    
        21    and you?
    ghostwu@dev:~/linux/more$ more -s ghostwu.txt 
    this is ghostwu
    
    how are you
    
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    file thank you
    
    and you?
    ghostwu@dev:~/linux/more$ 
    ghostwu@dev:~/shell_script$ more -10 install.sh 
    #!/bin/bash
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
    export PATH
    LANG=en_US.UTF-8
    
    is64bit=`getconf LONG_BIT`
    if [ "$is64bit" = '32' ];then
        echo '=================================================';
        echo -e "33[31m BT-Panel Incompatible 32 bit OS. 33[0m";
        exit;
    --More--(2%)
    ghostwu@dev:~/linux/more$ ls / | more -10
    bin
    boot
    cdrom
    dev
    etc
    home
    initrd.img
    lib
    lib64
    lost+found
    --More--

    交互子命令

    空格键:向下滚动一屏

    b:返回上一屏

    f:也可以向下滚动一屏

    /查找文本

    :f 输出文件名和当前的行数

    q:退出more命令

  • 相关阅读:
    css 图片的无缝滚动
    有时间研究下这个
    js的类数组对象
    js的this什么时候会出现报错
    js前端分页
    js队列
    js前端处理url中的参数为对象
    随机看的一点代码
    js的callee和caller方法
    js的Object和Function
  • 原文地址:https://www.cnblogs.com/ghostwu/p/9054244.html
Copyright © 2011-2022 走看看