当前位置:网站首页>Rhcsa learning practice
Rhcsa learning practice
2022-07-04 10:17:00 【Attiude】
1. Use whereis lookup locate command
Use which lookup whereis command
Use locate lookup rm command
[[email protected] ~]# locate -c rm
5228
[[email protected] ~]# whereis locate
locate: /usr/bin/locate /usr/share/man/man1/locate.1.gz
[[email protected] ~]# which whereis
/usr/bin/whereis
2.find Command to use : Use find Command to find all ordinary files in the current path Use find Command to find... In the current path file1.txt,file2.txt,file3.txt Use find The command to find the file owner is root The ordinary documents of Use find The command search modification time is 1 Ordinary documents within days
[[email protected] ~]# find -type f # All text files
[[email protected] ~]# find -type l # All linked files
[[email protected] ~]# find find_test1 find_test2 find_test3
find_test1
find_test2
find_test3
[email protected] ~]# find -user root | find -type l # Find the user as root Common files under
[[email protected] ~]# find -mtime -1 |find -type l # Documents modified within one day
3.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
[[email protected] ~]# cut -s -f1 cut_data.txt
[[email protected] ~]# cut -s -f1,3 cut_data.txt
[[email protected] ~]# cut -b 1-10 cut_data.txt
[[email protected] ~]# cut -c 1-5 cut_data.txt
[[email protected] ~]# cut -d"|" -f 1,3 cut_data.txt
4.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
[[email protected] ~]# uniq uniq_data.txt
[[email protected] ~]# uniq -d uniq_data.txt
[[email protected] ~]# uniq -u uniq_data.txt
[[email protected] ~]# uniq -c -d uniq_data.txt
5.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
[email protected] ~]# sort -n num.txt > sorted_num.txt
Yes args.txt Sort , And output the results to sorted_args.txt in
[[email protected] ~]# sort -n args.txt > sorted_merge.txt
Yes num.txt and args.txt Sort , And output the results to sorted_merge.txt in
[[email protected] ~]# sort -n args.txt num.txt > sorted_merge.txt
Yes args.txt After sorting, de re output
[[email protected] ~]# sort -n -u args.txt
Merge sorted_args.txt and sorted_num.txt And output
[[email protected] ~]# sort args.txt num.txt
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
[[email protected] ~]# sort -n -k 2 info.txt
6. 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 ( Prompt to use wildcards )
take hello 123 world 456 Replace letters and spaces in , Just keep the numbers ( Prompt to use wildcards )
7.wc Command to use : Given the file :word_count.txt, It's filled with 10 Row content Count by byte Count by word Count by
[[email protected] ~]# wc -l word_count.txt # Count by
10 word_count.txt
[[email protected] ~]# wc -w word_count.txt # Count by word
11 word_count.txt
[[email protected] ~]# wc -c word_count.txt # Count by byte
边栏推荐
- PHP代码审计3—系统重装漏洞
- Use C to extract all text in PDF files (support.Net core)
- Hands on deep learning (42) -- bi-directional recurrent neural network (BI RNN)
- Devop basic command
- Lavel document reading notes -how to use @auth and @guest directives in lavel
- Whether a person is reliable or not, closed loop is very important
- MongoDB数据日期显示相差8小时 原因和解决方案
- 什么是 DevSecOps?2022 年的定义、流程、框架和最佳实践
- Summary of small program performance optimization practice
- Talk about scalability
猜你喜欢
Custom type: structure, enumeration, union
入职中国平安三周年的一些总结
Baidu R & D suffered Waterloo on three sides: I was stunned by the interviewer's set of combination punches on the spot
C语言指针经典面试题——第一弹
MongoDB数据日期显示相差8小时 原因和解决方案
Debug:==42==ERROR: AddressSanitizer: heap-buffer-overflow on address
Intelligent gateway helps improve industrial data acquisition and utilization
六月份阶段性大总结之Doris/Clickhouse/Hudi一网打尽
Hands on deep learning (37) -- cyclic neural network
品牌连锁店5G/4G无线组网方案
随机推荐
Custom type: structure, enumeration, union
Kotlin: collection use
Check 15 developer tools of Alibaba
Kubernetes CNI 插件之Fabric
Map container
Vs201 solution to failure to open source file HPP (or link library file)
品牌连锁店5G/4G无线组网方案
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
Velodyne configuration command
Pcl:: fromrosmsg alarm failed to find match for field 'intensity'
Exercise 9-4 finding books (20 points)
How can Huawei online match improve the success rate of player matching
Devop basic command
leetcode729. My schedule 1
uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示
Use the data to tell you where is the most difficult province for the college entrance examination!
Exercise 7-2 finding the maximum value and its subscript (20 points)
Kotlin 集合操作汇总
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
If the uniapp is less than 1000, it will be displayed according to the original number. If the number exceeds 1000, it will be converted into 10w+ 1.3k+ display