linux下打开大文件且搜索字符串的方法

使用more命令

一、more file.name

二、ctr f ctr b上下翻页

三、查找字符串的方法

输入  v 键即可;

此时会进入上下水平分割的两个窗口

四、退出快捷键:q

使用less命令,本质是只打开部分

可以直接使用/命令进入查找模式;原理同于vim

大部分博文上说明用less比more快

解释如下:

more: more is a very basic,oldest and popular pager. more is originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement. i.e. more can move forwards and backwards in text files but cannot move backwards in pipes.

less: less is a more advanced pager that allows movement forward and backward, and contains extra functions such as search. less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi.

mostless is more than moremost is more than less. Whereas the other pagers can only display one file at a time, most is capable of viewing any number of files,

本人电脑上没有most命令;目前的结论是less完全取代more

查看使用帮助:

man more

man less

而不仅仅是-help

发布了447 篇原创文章 · 获赞 153 · 访问量 49万+

猜你喜欢

转载自blog.csdn.net/ningyanggege/article/details/104783087