1, give you a RPM package, query whether installed, installed how to delete
Rpm-qa rsync to see if the Rsync pack is installed
Rpm-e rsync Offload rsync pack--nodeps ignore dependencies
2. View disk space
Df-h
3, 443 port is what service
Cat/etc/service
Https
4, Some files, how to change the file extension. txt to. html
Method 1:
Rename. txt. html *.txt
Method 2:
Find. -type f-name "*.txt"-print0 | xargs-0 rename. txt. html {}
Using the-print0 and Xargs-0 options of Find, you can resolve a problem that contains spaces in the file name.
Method 3:
for file in *.txt; Do MV $file ${file%.txt}.html; Done
5. Query the line number of empty line inside file
Grep-n ^$ 123.sh
Grep-n ^$ 123.sh |awk-f ': ' {print $} '
Sed-n '/^$/= ' 123.sh
awk ' $ ~/^$/{print NR} ' 123.sh
6. Query File1 the line ending with ABC
grep-ntmp$ 123.sh Excellent
sed-n '/tmp$/= ' 123.sh
7. Print out the first to third line of file1 files
Head-3 123.sh
Sed-n ' 1,3p ' 123.sh
This article from "Small http Happy Life" blog, declined reprint!