当前位置:网站首页>The fourth job: about the usage of cat, grep, cut, sort, uniq, VIM, TR and other commands
The fourth job: about the usage of cat, grep, cut, sort, uniq, VIM, TR and other commands
2022-07-24 05:13:00 【cy11114】
Homework today :
1. File content browsing
a.cat see /etc/passwd The contents of the document , And output with line number
b. Use more/less see /etc/passwd Content , And each page displays 10 That's ok
c. Use head/tail Before viewing the files separately 5 Line content and after 5 Row content
d. Use grep see /etc/passwd neutralization root Related content
2.cut Command to use :
Given the file cut_data.txt And the content is :
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60
Use the default delimiter to cut the contents of the file , And output the first field after cutting
Cut file content , And output the first field and the third field after cutting
Cut by byte : Output the first byte to the second byte of the cut 10 Bytes of content
Cut by character : Output the first character and the second character after cutting 5 The content of a character
Cut according to the specified delimiter : The contents are as follows , Output the contents of the first field and the third field
No|Name|Score
1|zhang|20
2|li|80
3|wang|90
4|sun|60
3.uniq Command to use : New file uniq_data.txt, The content of the document is
Welcome to Linux
Windows
Windows
Mac
Mac
Linux
Use uniq The command outputs the result after de duplication
Use uniqmingl Output only duplicate lines
Use uniq The command outputs non repeating lines
Use uniq The command counts the number of repetitions
4.sort command : Given the file num.txt, args.txt
The contents of the document :num.txt
1
3
5
2
4
The contents of the document :args.txt
test
args1
args2
args4
args4
args3
Yes num.txt Sort , And output the results to sorted_num.txt in
Yes args.txt Sort , And output the results to sorted_args.txt in
Yes num.txt and args.txt Sort , And output the results to sorted_merge.txt in
Yes args.txt After sorting, de re output
Merge sorted_args.txt and sorted_num.txt And output
Given the file info_txt: Press the second column as key Sort
No Name Score
1 zhang 20
2 li 80
3 wang 90
4 sun 60
5. take 26 After a lowercase letter 13 Replace the first letter with a capital letter
take hello 123 world 456 Replace the numbers in with empty characters
take hello 123 world 456 Replace letters and spaces in , Just keep the numbers

边栏推荐
- Basic knowledge of MySQL database
- Chapter VI more supervision training
- 【深度学习】(三)图像分类
- IDEA:SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
- The opening ceremony of the 2022 Huawei developer competition in China kicked off!
- Sort - quicksort
- 口叫SC 或者 pb 文件为读写控制ensor为
- Middle aged crisis, workplace dad who dare not leave, how to face life's hesitation
- 微信朋友圈的高性能架构设计
- 472-82 (22, 165, 39, sword finger offer II 078, 48. Rotate image)
猜你喜欢

利用a*启发式搜索解决迷宫寻路问题

Kingbase V8R6集群安装部署案例---脚本在线一键缩容

The x-fkgom supporting the GOM engine key.lic is authorized to start

How can e-commerce projects solve the over issuance of online coupons (troubleshooting + Solutions) (glory Collection)
![Codeforce:d2. remove the substring (hard version) [greedy string + subsequence]](/img/c1/320e0349e2edda0eb420ed018aa831.png)
Codeforce:d2. remove the substring (hard version) [greedy string + subsequence]

Jiang Xingqun, senior vice president of BOE: aiot technology enables enterprise IOT transformation

Image painting for irregular holes using partial revolutions paper notes

IDEA:SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.

Chapter III encog workbench

Crazy God redis notes 09
随机推荐
本,降低线上要度是一样的。发现异常实例cp操
Sword finger offer special assault edition day 7
What is the sandbox technology in the data anti disclosure scheme?
Numpy statistical correlation function example tutorial
Xiaohongshu joins hands with HMS core to enjoy HD vision and grow grass for a better life
frp内网穿透服务使用
HCIA NAT experiment
It is related to the amount of work and ho. Embedded, only one 70 should be connected
C primer plus learning notes - 5. Pointer
Event extraction and documentation (2019)
Chapter 9 using image data
Foreign key operation of MySQL_ Cascade operation
Chapter V communication training
Jetson device failed to download repository information use tips to record
How can e-commerce projects solve the over issuance of online coupons (troubleshooting + Solutions) (glory Collection)
Kingbase V8R6集群安装部署案例---脚本在线一键缩容
Image to image translation with conditional advantageous networks paper notes
SHP building contour data restoration, 3D urban white film data production
IDEA:SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
2. Input a circle radius r, when r > = 0, calculate and output the area and perimeter of the circle, otherwise, output the prompt information.