linux命令11,每日一个linux命令11-more
1. 命令解析
命令用途:
與cat全部顯示文件內(nèi)容不同,more用于分頁顯示文件內(nèi)容,通過使用空格或者CTRL+F翻頁,或使用CTRL+B后退一頁;
命令格式:
more [options] file...
命令參數(shù):
-NUM specify the number of lines per screenful
+NUM display file beginning from line number NUM
+/STRING display file beginning from search string match
常用操作命令:
Enter 向下n行,需要定義。默認為1行
Ctrl+F 向下滾動一屏
空格鍵 向下滾動一屏
Ctrl+B 返回上一屏
= 輸出當前行的行號
:f 輸出文件名和當前行的行號
V 調(diào)用vi編輯器
!命令 調(diào)用Shell,并執(zhí)行命令
q 退出more
2. 示例
2.1 從第3行開始分頁顯示文件內(nèi)容
[root@test fs]# more +3 Kconfig
2.2 從文件中查找第一個出現(xiàn)"fs"字符串的行,并從該行前兩行開始顯示
root@test fs]# more +/fs Kconfig
...skipping
if BLOCK
source "fs/ext2/Kconfig"
source "fs/ext3/Kconfig"
source "fs/ext4/Kconfig"
2.3 設(shè)定每屏顯示行數(shù)
[root@test fs]# more -5 Kconfig
#
# File system configuration
#
menu "File systems"
--More--(0%)
2.4 使用more過濾ls的輸出
[root@test fs]# ll |more +/sysfs -2
...skipping
drwxr-xr-x. 2 root root 4096 Jul 9 2014 sysfs
drwxr-xr-x. 2 root root 4096 Jul 9 2014 sysv
drwxr-xr-x. 2 root root 4096 Jul 9 2014 ubifs
總結(jié)
以上是生活随笔為你收集整理的linux命令11,每日一个linux命令11-more的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: amazon linux 安装nginx
- 下一篇: 西工大c语言noj100作业,西工大17