京公网安备 11010802034615号
经营许可证编号:京B2-20210330
今天我们来详细讲解下,Linux浏览文件的三种命令,它们分别是:cat、less、more!
cat命令: 一次性在终端中显示文件的所有内容
cat Facebook首席运营官桑德伯格《Lean\ In》.txt
cat命令显示出多少行呢?
参数:n 由 1 开始对所有输出的行数进行编号
cat -n Facebook首席运营官桑德伯格《Lean\ In》.txt
cat命令还可以连接多个文本的内容一起输出
cat -n hello.txt word.txt
less命令: 分页显示文件内容
less和cat最大的区别是:less命令会分一页一页地显示文件内容,cat会一次性全部显示
less Facebook首席运营官桑德伯格《Lean\ In》.txt
这时我们会看到 less命令不会一次性读取 ‘Facebook首席运营官桑德伯格《Lean\ In》.txt’ 文本里的全部内容,而是会分页读取,每一页读取内容的多少是由你的终端大小来决定的
less命令浏览文件的快捷键:
注意:这里快捷键的字母都是区分大小写的
less命令浏览文件高级快捷键的使用
“=”键:显示当前页面的内容是文件中第几行到第几行,按Enter键撤销
Facebook首席运营官桑德伯格《Lean\ In》.txt lines 5-10/287 byte 4308/171635 3% (press RETURN)
下面我们就对这段描述信息座椅详细的解释:
Facebook首席运营官桑德伯格《Lean\ In》.txt: 表示当前正在读取文件的名称
lines 5-10/287: 表示这个文本总共有287行,当前正在读取的是5-10行
byte 4308/171635: 表示文本总共有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 company three and a half years earlier when it was an obscure start-up with a few hundred employees in a run-down office building. By my first trimester, Google had grown into a company of thousands and moved into a multibuilding campus.
My pregnancy was not easy. The typical morning sickness that often accompanies the first trimester affected me every day for nine long months. I gained 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 coffee table. A particularly sensitive Google engineer announced that “Project Whale” was named after me.
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 so quickly that parking was an ongoing problem, and the only spot I could find was quite far away. I sprinted across the parking lot, which in reality meant lumbering a bit more quickly than my absurdly slow pregnancy crawl. This only made my nausea worse, 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 husband, Dave. He pointed out that Yahoo, where he worked at the time, had designated parking for expectant mothers at the front of each building.
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 a large room with toys and gadgets strewn all over the floor. I found Sergey in a yoga position in the corner and announced that we needed pregnancy parking, preferably sooner rather than later. He looked up at me and agreed immediately, noting that he had never thought about it before.
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 one of Google’s most senior women, didn’t I have a special responsibility to think of this? But 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 to demand that the problem be fixed. Having one pregnant woman at the top—even one who looked like a whale—made the difference.
数据分析咨询请扫描二维码
若不方便扫码,搜微信号:CDAshujufenxi
在游戏产业的商业逻辑中,付费玩家是支撑游戏生存与发展的核心支柱。行业普遍遵循 “二八定律”:20% 的付费玩家贡献了游戏 80% ...
2026-06-11【核心关键词】企业、定位、传统、产品、互联网、可视化、业务侧、数字化、结构化、数据分析、传统制造业、市场状态、发展空间 ...
2026-06-11 解读《CDA二级教材:量化策略分析(2025)》的全景结构与学习逻辑 ” CDA二级认证是企业招聘数据分析师时最常提及的证书门槛 ...
2026-06-11【核心关键词】药企、可视化、营销、分类、数据分析师、销售数据、业务人员、指导方向、分析报告、营销数据、营销医生 【专访摘 ...
2026-06-10在统计学分析、问卷调研、实验验证、业务复盘等场景中,卡方检验与 T 检验是应用最广泛的两类基础假设检验方法。前者专门处理分 ...
2026-06-10 很多数据分析师每天都在计算指标、制作报表,但当被问到“什么叫指标数据元”“指标数据标准包含哪些核心维度”“指标数据质 ...
2026-06-10在MySQL数据库日常查询、数据统计、后台接口开发、数据导出等场景中,开发者经常需要查询数据表除某几列之外的所有字段。例如查 ...
2026-06-09在Python网络请求、爬虫开发、接口测试、数据抓取等实操场景中,requests库是最常用的第三方请求工具,而content属性是requests ...
2026-06-09 数据分析正在重塑每一个行业。CDA认证的三本官方教材,分别对应Level I、Level II、Level III,为你铺就从业务数据分析到数 ...
2026-06-09在数字财务、智慧财税、业财融合深度推进的当下,传统财务模式下数据标准混乱、业务流程碎片化、知识无法沉淀、系统互通性差等问 ...
2026-06-08随着数字经济深度渗透各行各业,数据正式成为继土地、劳动力、资本、技术之后的第五大生产要素,是企业数字化转型、精细化运营、 ...
2026-06-08 很多数据分析师能熟练写SQL、做透视表,但当被问到“数据是从哪里来的?经过哪些加工才进入数据仓库?ETL具体做了什么?”时 ...
2026-06-08【核心关键词】贷款、报表、课程、专业、建模、缺失值、营销、互联网、银行、办公自动化、数据分析、数据预处理、特征工程、贷 ...
2026-06-05在数据库数据查询、业务报表统计、多表关联分析中,LEFT JOIN左连接是使用率最高的SQL关联查询语句。其核心特性是保留左表全部数 ...
2026-06-05 很多数据分析师能熟练地写SQL、做透视表、算描述性统计,但当被问到“如何预测用户流失概率”“如何归因销量下滑的关键因素 ...
2026-06-05任何一款产品从诞生、普及到最终退出市场,都会遵循一套固定的发展规律,这就是产品生命周期理论。在市场竞争日益激烈、产品迭代 ...
2026-06-04在Excel数据分析、办公统计、业务报表制作场景中,数据透视表是数据汇总、分类统计、快速复盘的核心工具,能够高效完成海量原始 ...
2026-06-04 很多数据分析师拿到数据就开始清洗、建模,但当被问到“这批数据属于什么类型——结构化还是非结构化?分类变量还是数值变量 ...
2026-06-04在问卷调查与社会科学数据分析中,卡方检验是最常用、最基础的非参数检验方法,广泛应用于市场调研、用户分析、行为统计、满意度 ...
2026-06-03【核心关键词】贷款、报表、课程、专业、建模、缺失值、营销、互联网、银行、办公自动化、数据分析、数据预处理、特征工程、贷 ...
2026-06-03