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 "\033[31m BT-Panel Incompatible 32 bit OS. \033[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命令

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM