当前位置:网站首页>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

边栏推荐
- On the dilemma faced by non transferable reputation points NFT SBTS
- FRP intranet penetration service usage
- In his early 30s, he became a doctoral director of Fudan University. Chen Siming: I want to write both codes and poems
- postgresql:在Docker中运行PostgreSQL + pgAdmin 4
- Globally and locally consistent image completion paper notes
- Sword finger offer special assault edition day 7
- HCIA NAT experiment
- Memorandum 2022
- HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier
- How to solve the engine prompt alias herodb and game engine startup exceptions?
猜你喜欢

Update C language notes

How can NFT, whose stars enter the market against the market, get out of the independent market?
![GOM engine starts M2 prompt: [x-fkgom] has been loaded successfully. What should I do if it gets stuck?](/img/32/df602f294e009c9462d955b1819ffe.png)
GOM engine starts M2 prompt: [x-fkgom] has been loaded successfully. What should I do if it gets stuck?

High performance architecture design of wechat circle of friends

Heavy! The 2022 China open source development blue book was officially released

Hcip-- review the homework for the next day

Using a* heuristic search to solve maze routing problem

pso和mfpso

Zhaoyi innovation gd25wdxxk6 SPI nor flash product series comes out

Bear market bottoming Guide
随机推荐
京东方高级副总裁姜幸群:AIoT技术赋能企业物联网转型
How can e-commerce projects solve the over issuance of online coupons (troubleshooting + Solutions) (glory Collection)
Mrs +apache Zeppelin makes data analysis more convenient
本,降低线上要度是一样的。发现异常实例cp操
What programmer is still being grabbed by the company at the age of 35? Breaking the "middle-aged crisis" of programmers
Foreign key operation of MySQL_ Cascade operation
C primer plus learning notes - 5. Pointer
MapReduce concept
The opening ceremony of the 2022 Huawei developer competition in China kicked off!
Recursive cascade network: medical image registration based on unsupervised learning
In his early 30s, he became a doctoral director of Fudan University. Chen Siming: I want to write both codes and poems
Context encoders: feature learning by painting paper notes
The network NN can calculate the NTCP provided by the host system
C. Recover an RBS(括号序列,思维)
Fiddler抓包工具的使用
7. Find the sum of numbers between 100 and 300 that can be divided by 3.
The difference between run and start in thread class
Add.Eslinctrc.js under SRC for the general format of the project
[postgraduate entrance examination vocabulary training camp] day 10 - capital, expand, force, adapt, depand
Two methods of modifying configuration files in PHP