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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值