当前位置:网站首页>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中字母和空格替换掉,只保留数字(提示使用通配符)

边栏推荐
- [problem solving] ibatis.binding BindingException: Type interface xxDao is not known to the MapperRegistry.
- "Autobiography of Franklin" cultivation
- R language uses wilcox The test function performs Wilcox signed rank test to obtain the confidence interval of the population median (the default output result includes the confidence interval of 95%
- 卷积神经网络模型之——AlexNet网络结构与代码实现
- Detailed explanation of the training and prediction process of deep learning [taking lenet model and cifar10 data set as examples]
- 【运维、实施精品】月薪10k+的技术岗位面试技巧
- Shell common script: check whether a domain name and IP address are connected
- 并发编程 — 内存模型 JMM
- [six articles talk about scalablegnn] around www 2022 best paper PASCA
- Use vsftpd service to transfer files (anonymous user authentication, local user authentication, virtual user authentication)
猜你喜欢

Django 2 ----- 数据库与Admin

web安全入门-UDP测试与防御

Chapter5 : Deep Learning and Computational Chemistry

程序员奶爸自制AI喂奶检测仪,预判宝宝饿点,不让哭声影响老婆睡眠

Zero basic learning canoe panel (12) -- progress bar

Mlx90640 infrared thermal imager temperature sensor module development notes (V)

【AI4Code】《Pythia: AI-assisted Code Completion System》(KDD 2019)

【AI4Code】《IntelliCode Compose: Code Generation using Transformer》 ESEC/FSE 2020

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

【AI4Code】《CoSQA: 20,000+ Web Queries for Code Search and Question Answering》 ACL 2021
随机推荐
【重温SSM框架系列】15 - SSM系列博文总结【SSM杀青篇】
机器学习强基计划0-4:通俗理解奥卡姆剃刀与没有免费午餐定理
Mlx90640 infrared thermal imager temperature sensor module development notes (V)
部署Apache网站服务以及访问控制的实现
How to use causal inference and experiments to drive user growth| July 28 tf67
ECCV 2022 | 登顶SemanticKITTI!基于二维先验辅助的激光雷达点云语义分割
Convolutional neural network model -- lenet network structure and code implementation
Go: Gin custom log output format
MySQL remote connection permission error 1045 problem
一味地做大元宇宙的规模,已经背离了元宇宙本该有的发展逻辑
零基础学习CANoe Panel(12)—— 进度条(Progress Bar)
需求规格说明书模板
massCode 一款优秀的开源代码片段管理器
ESP32-C3 基于Arduino框架下Blinker点灯控制10路开关或继电器组
网络空间安全 渗透攻防9(PKI)
程序的内存布局
EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心
[CSDN year-end summary] end and start, always on the way - "2021 summary of" 1+1= Wang "
AtCoder Beginner Contest 261 F // 树状数组
R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions