Replace file1 with the actual file as follows
1. query the row number of the empty row in file1.Grep-n "^ $" stl_stable_sort.ccRefer:Common grep commands
2. query the rows ending with ABC in file1.Grep-n "^. * ABC $" stl_stable_sort.ccRefer:Regular Expression 30-minute getting started tutorial grep Common commands
3. Print the file1 file 1st to the third line.Sed-N '1, 3' P stl_stable_sort.ccRefer:Sed command for simple use
2. How to forward requests from local port 80 to port 8080. The current host IP address is 192.168.2.1
Iii. crontab
How can I implement/usr/bin/httpd. Sh every two hours from to in March?
Edit the/etc/crontab file
0 6-12/2 *** root/usr/bin/httpd. Sh
4. Write a shell script to transfer files larger than K under the/usr/local/test directory to the/tmp directory.Ls-L | grep ^-| awk '$5> 100000' | awk '{print $8}' | xargs-t-I {} CP {} TestRefer:[Command tips] ls xargs command
Note:{} Can be understood as the previous parameter. Look at the example
Ls a | xargs-I MV {}{}. Bak
-I is the same as-I.
7. How to view the processes occupying port 8080Lsof-I: 8080Refer:Common lsof commands