今天我们将详细介绍Linux浏览文件的三个命令:cat、less和more。
Cat命令:在终端上一次性显示文件的所有内容
猫Facebook首席运营官桑德伯格《Lean In》。txt
Cat命令显示了多少行?
参数:n从1开始对所有输出的行数进行编号
CAT-N Facebook首席运营官桑德伯格《Lean In》。txt
Cat命令还可以连接多个文本的内容,并一起输出
Cat -n word.txt
Less命令显示:页文件内容
Less和cat最大的区别是,less命令一页一页地显示文件内容,cat一次全部显示
Less Facebook COO桑德伯格《Lean In》。txt
这时我们发现less命令是“Facebook首席运营官桑德伯格《Lean In》。可以看出,“txt”文本的全部内容不是一次性阅读,而是逐页阅读。每页阅读的内容量取决于你的终端大小。
Less命令文件浏览快捷键:
注意:其中快捷键中的字符区分大小写
Less命令文件导航使用高级快捷键
“=”键:显示当前页面的内容从文件的前几行到第几行。按Enter键取消
Facebook首席运营官桑德伯格《Lean In》 . txtlines 5-10/287 Byte 4308/171635 3%(press return)
让我详细说明一下这个说明信息座位。
Facebook首席运营官桑德伯格《Lean In》 .txt:表示,目前正在读取文件名。
第5-10/287行:此文本共有287行,表示当前正在读取5-10行
BYTE 4308/1716353360共代表171635个字符的文本,目前正在阅读4308个字符。
%3:表示当前读取的内容占文本内容的总数%3
h键:转到快捷键的帮助文档,然后按q键退出
/(斜线):进入搜索模式
示例:关键字more搜索
要移动到搜索中的下一个匹配项,可以按n键,然后按n键移动到上一个匹配项。
More命令
More命令与less命令类似,但没有功能强大的less命令
例如:more命令不能向后翻页,一次只能向前移动一页
这是因为more命令出现在less命令之前
注:这是Facebook首席运营官桑德伯格《Lean In》的部分章节,可以对cat、less命令进行实战练习,从而更好地理解less命令的长处。
I got pregnant with my first child in the summer of 2004 . at the time,I was running the online sales and operations groups at Google . I had joined the
我的pregnancy was not easy . the typical morning sickness that often accompanies the first trimester affected me every day for nine long months.Almost seventy pounds,and my feet swelled two entire shoe sizes,Turning into odd-shaped lumps I could see only when they were propped up on a
One day,after a rough morning spent staring at the bottom of the toilet,I had to rush to make an important client meeting . Google was growing SSE and I arrived at the meeting praying that a sales pitch was the only thing that would come out of my mouth . that night,I recounted these troubles to my
The next day,I marched in-or more like waddled in-to see Google founders Larry page and Sergey Brin in their office,Which was really just
To this day,I ' m embarrassed that I didn ' t realize that pregnant women needed reserved parking until I experienced my own aching feet . as oneBut like Sergey,it had never occurred to me。the other pregnant women must have suffered in silence,Not wanting to ask for special treatment . or maybe they lacked the confidence or seniority
(1)要获得更多优质内容和精彩信息,请访问以下网站:
(2)详细了解数据领域的高级课程。
1.《.cat文件如何打开看这里!Linux浏览文件命令:cat、less、more详解》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。
2.《.cat文件如何打开看这里!Linux浏览文件命令:cat、less、more详解》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。
3.文章转载时请保留本站内容来源地址,https://www.lu-xu.com/gl/2121179.html