当前位置:网站首页>0716RHCSA
0716RHCSA
2022-07-25 12:59:00 【Psc_February2】
一、文件内容浏览
1)cat查看/etc/passwd文件内容,且输出时带行号:
2)使用more/less查看/etc/passwd内容,且每页显示10行:
3)使用head/tail分别查看文件前5行内容和后5行内容:
4)使用grep查看/etc/passwd中和root相关的内容:
二、cut命令:
给定文件cut_data.txt且内容为:
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60
按指定分界符去切割时的文本:
No|Name|Score
1|zhang|20
2|li|80
3|wang|90
4|sun|60- 使用默认定界符切割文件内容,且输出切割后的第一个字段
- 切割文件内容,且输出切割后的第一个字段和第三个字段
- 按字节切割:输出切割的第一个字节到第10个字节的内容
- 按字符切割:输出切割后的第一个字符和第5个字符的内容
- 按指定分界符去切割, 输出第一个字段和第三个字段内容




三、uniq命令:
新建文件uniq_data.txt,文件内容为
Welcome to Linux
Windows
Windows
Mac
Mac
Linux使用uniq命令输出去重后的结果 
使用uniq命令只输出重复的行 
使用uniq命令输出不重复的行
使uniq命令统计重复次数
四、sort命令:
新建文件 num.txt, args.txt
文件内容:num.txt
(有两个空格)1
3
5
2
4
文件内容:args.txt
test
args1
args2
args4
args4
args3
给定文件info_txt:按第二列作为key进行排序
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60
对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进行排序
五、tr命令:
将26个小写字母的后13个字母替换成大写字母

将hello 123 world 456中的数字替换成空字符(提示使用通配符)

将hello 123 world 456中字母和空格替换掉,只保留数字(提示使用通配符)

边栏推荐
- Shell常用脚本:判断远程主机的文件是否存在
- Mysql 远程连接权限错误1045问题
- Deployment of Apache website services and implementation of access control
- 好友让我看这段代码
- 网络空间安全 渗透攻防9(PKI)
- Date and time function of MySQL function summary
- Machine learning strong foundation program 0-4: popular understanding of Occam razor and no free lunch theorem
- 从输入网址到网页显示
- 【重温SSM框架系列】15 - SSM系列博文总结【SSM杀青篇】
- VIM tip: always show line numbers
猜你喜欢

从输入网址到网页显示

Make a general cascade dictionary selection control based on jeecg -dictcascadeuniversal

【AI4Code】《Contrastive Code Representation Learning》 (EMNLP 2021)

Shell常用脚本:获取网卡IP地址

业务可视化-让你的流程图'Run'起来(3.分支选择&跨语言分布式运行节点)

Machine learning strong foundation program 0-4: popular understanding of Occam razor and no free lunch theorem

massCode 一款优秀的开源代码片段管理器
![[operation and maintenance, implementation of high-quality products] interview skills for technical positions with a monthly salary of 10k+](/img/d8/90116f967ef0f5920848eca1f55cdc.png)
[operation and maintenance, implementation of high-quality products] interview skills for technical positions with a monthly salary of 10k+

yum和vim须掌握的常用操作

工业互联网的内涵及其应用
随机推荐
Force deduction 83 biweekly T4 6131. The shortest dice sequence impossible to get, 303 weeks T4 6127. The number of high-quality pairs
Emqx cloud update: more parameters are added to log analysis, which makes monitoring, operation and maintenance easier
Docekr learning - MySQL 8 master-slave replication setup deployment
The programmer's father made his own AI breast feeding detector to predict that the baby is hungry and not let the crying affect his wife's sleep
【AI4Code】《CoSQA: 20,000+ Web Queries for Code Search and Question Answering》 ACL 2021
网络空间安全 渗透攻防9(PKI)
一味地做大元宇宙的规模,已经背离了元宇宙本该有的发展逻辑
【AI4Code】《Unified Pre-training for Program Understanding and Generation》 NAACL 2021
Docker learning - redis cluster -3 master and 3 slave - capacity expansion - capacity reduction building
使用vsftpd服务传输文件(匿名用户认证、本地用户认证、虚拟用户认证)
B tree and b+ tree
Vim技巧:永远显示行号
卷积核越大性能越强?一文解读RepLKNet模型
卷积神经网络模型之——LeNet网络结构与代码实现
Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
pytorch创建自己的Dataset加载数据集
错误: 找不到或无法加载主类 xxxx
零基础学习CANoe Panel(16)—— Clock Control/Panel Control/Start Stop Control/Tab Control
Mlx90640 infrared thermal imager temperature sensor module development notes (V)
【AI4Code】CodeX:《Evaluating Large Language Models Trained on Code》(OpenAI)