当前位置:网站首页>rhcsa笔记四
rhcsa笔记四
2022-07-23 15:55:00 【zyfpkp】
1.文件内容浏览
a.cat查看/etc/passwd文件内容,且输出时带行号

b.使用more/less查看/etc/passwd内容,且每页显示10行

c.使用head/tail分别查看文件前5行内容和后5行内容

d.使用grep查看/etc/passwd中和root相关的内容
2.cut命令使用
给定文件cut_data.txt且内容为:
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60
使用默认定界符切割文件内容,且输出切割后的第一个字段切割文件内容

且输出切割后的第一个字段和第三个字段

按字节切割:输出切割的第一个字节到第10个字节的内容

按字符切割:输出切割后的第一个字符和第5个字符的内容

按指定分界符去切割:内容如下, 输出第一个字段和第三个字段内容

3.uniq命令使用
新建文件uniq_data.txt,文件内容为
Welcome to Linux
Windows
Windows
Mac
Mac
Linux
使用uniq命令输出去重后的结果

使用uniq命令只输出重复的行

使用uniq命令输出不重复的行

使用uniq命令统计重复次数

4.sort命令
给定文件 num.txt, args.txt
文件内容:num.txt
1
3
5
2
4
文件内容:args.txt
test
args1
args2
args4
args4
args3
对num.txt进行排序,且将结果输出到sorted_num.txt中

对args.txt进行排序,且将结果输出到sorted_args.txt中


对num.txt和args.txt进行排序,且将结果输出到sorted_merge.txt中

对args.txt排序后去重输出

合并sorted_args.txt和sorted_num.txt且输出

给定文件info_txt:按第二列作为key进行排序
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60

5.
将26个小写字母的后13个字母替换成大写字母

将hello 123 world 456中的数字替换成空字符

将hello 123 world 456中字母和空格替换掉,只保留数字

边栏推荐
- Pdman, a database modeling tool comparable to PowerDesigner [easy to understand]
- Specify the port number in topology.yaml
- curl get&post
- Non inherited polymorphic ideas cooperate with typeID to realize the transmission of different parameters
- CSDN custom T-shirts are waiting for you to get, and the benefits of new programmer are coming!
- 没有发现必备补丁文件‘NewopUI.pak’?
- Warehouse address of Aspose
- Detailed explanation of curl command [easy to understand]
- 卡方分布、方差分析
- curl命令详解[通俗易懂]
猜你喜欢

rhcsa笔记五

Keras II classification problem

idea debug常用操作

Use moment to get the date of the current day and the next day

数字安全巨头Entrust披露六月遭到勒索软件团伙攻击

Lin Zhiying is still in the intensive care unit and will undergo a second round of surgery: the police said he did not wear a seat belt

悲观锁和乐观锁

El input usage

配置Gom引擎登錄器出現錯誤提示:沒有發現必備補丁文件!

Ali Er Mian: what is CAS?
随机推荐
Docker installs redis and starts it as a configuration file
MySQL8.0.23四次重装都失败在 'Writing configuration file'
MySQL massive write problem optimization scheme MySQL parameter tuning
@Entity 里面的 JPA 注解
DB9串口和RJ45串口
VIM notes
Seata
RS232 DB9串口设备
【215】gin框架連接mysql數據庫
(十一)STM32——IO引脚复用与映射
CSDN定制T恤等你来拿,《新程序员》福利来袭!
C language -- implementation of address book and screentogif
go语言中的内存对齐是如何优化程序效率的?
Seal player IP and machine code and unlock the blocked tutorial
多线程编程
Go medium high parallel communication mode: the underlying principle of channel pipeline
强化学习---马尔可夫决策过程 MP MRP MDP
LDAP统一认证服务解决方案[通俗易懂]
curl get&post
go中的協程原理詳解
