实例1:显示文件中从第3行起的内容
[root@host-172-168-80-55 home]# cat test.log
aaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccc
ddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffff
gggggggggggggggggggggggggggg
[root@host-172-168-80-55 home]# more +3 test.log
ccccccccccccccccccccc
ddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffff
gggggggggggggggggggggggggggg
实例2:从文件中查找第一个出现"day3"字符串的行,并从该处前两行开始显示输出
[root@host-172-168-80-55 home]# more +/day1 test.log
...skipping
bbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccc
ddddd day1 ddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffff
gggggggggggggggggggggggggggg
实例3:设定每屏显示行数
more -3 test.log
实例4:列一个目录下的文件,由于内容太多,我们应该学会用more来分页显示。这得和管道 | 结合起来
ls –l | more -5
说明:
每页显示5个文件信息,按 Ctrl+F 或者 空格键 将会显示下5条文件信息。