more命令类似于cat,cat命令使整个文件的内容从上到下显示在屏幕上。more会一一页一页的显示翻遍使用者阅读,而最基本的指令就是按空格键(space)就往下一页显示,按b键就往回一页显示,而且还有搜索字符串的功能。more命令从前往后读取文件,因此在启动的时候就加载整个文件。
常用操作命令:
Enter 向下n行,需要定义。默认为1行。
Ctrl+F 向下滚动一屏
空格键 向下滚动一屏
Ctrl+B 返回上一屏
= 输出当前的行号
: f 输出文件名和当前的行号
V 调用VI编辑器
q 退出more
命令实例:
(1)控制一屏中行数的多少
[root@centos65 CP000154]# more -5 _source
{"references":[{"referencetag":"1 (bases 1 to 5394884)","journal":"J. Bacteriol. 192 (22), 6103-6104 (2010)","authors":"Kim,J.F., Jeong,H., Park,S.Y., Kim,S.B., Park,Y.K., Choi,S.K.,Ryu,C.M.
, Hur,C.G., Ghim,S.Y., Oh,T.K., Kim,J.J., Park,C.S. andPark,S.H.","title":"Genome Sequence of the Polymyxin-Producing Plant-ProbioticRhizobacterium Paenibacillus polymyxa E681","pubmed":"2085
1896"},{"referencetag":"2 (bases 1 to 5394884)","journal":"Submitted (14-OCT-2005) Lab of Microbial Genomics, Genome ResearchCenter, Korea Research Institute of Bioscience and Biotechnology(
KRIBB), Daejeon Yuseong PO Box 115, Yuseong-gu, Daejeon 305-600,Republic of Korea","authors":"Jeong,H., Kim,J.F., Kim,S.-B., Lee,C., Park,S.-Y., Park,Y.-K.,Ryu,C.-M., Moon,Y.H., Hur,C.-G., Pa
rk,C.S., Oh,T.K. and Park,S.-H.","title":"Direct Submission"}],"submitDate":"14-OCT-2005","submitAddress":"Lab of Microbial Genomics, Genome ResearchCenter, Korea Research Institute of Biosci
[root@centos65 CP000154]#
(2)
当查看一个文件夹下的所有文件的时候,如果文件过多,可以结合more命令实现翻页功能。这个时候要和管道流"|"结合起来使用
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537414
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537415
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537416
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537417
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537418
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537419
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537420
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537421
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537422
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537423
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537424
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537425
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537426
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537427
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537428
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537429
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537430
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537431
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537432
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537433
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537434
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537435
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537436
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537437
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537438
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537439
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537440
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537441
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537442
drwxr-xr-x 2 root root 20 Aug 27 08:45 FV537443
[root@centos65 seqs]# ls -l | more -5
total 0
drwxr-xr-x 2 root root 20 Aug 27 08:45 CP000154
drwxr-xr-x 2 root root 20 Aug 27 08:45 CP000155
drwxr-xr-x 2 root root 20 Aug 27 08:45 CP000156
drwxr-xr-x 2 root root 20 Aug 27 08:45 CP000157