1. Document Collation
Work number and name are recorded in the employee file
Employee.txt:
Jason Smith
John Doe
Sanjay Gupta
Ashok Sharma
Record work number and salary in bonus file
Bonus.txt:
100 $5,000
200
300 $3,000
400 $1,250
Requires merging two files and outputting the following
Processing results:
Ashok Sharma $1,250
Jason Smith $5,000
John Doe
Sanjay Gupta $3,000
# awk ' Argind==1{test[$1]=$0}argind==2{print test[$1],$2} 'Jason Smith $5,000200 John Doe $500300 Sanjay gupt A $3,000400 Ashok Sharma $1,250, Jason Smith, John Doe, Sanjay Gupta400
(2) View the size of the swap partition
# free-m Total used free shared buffers cachedmem: 1001 861 425-/+ buffers/cache: 338 663Swap: 509 0 509
(3) How long the root user landed today
Last Check all login information,
Lastlog View recent landing,
W or who view currently logged in user
(4) Print the port and process ID of the current sshd
# NETSTAT-ANP | grep sshd
(5) Print root can use the number of executable files
# echo "Root" s bins: $ (find./-type F | Xargs Ls-l | Sed '/-.. X/p ' | wc-l) "53
(6) Output the time it takes to create 20,000 directories natively
for Do mkdir neil$i donereal 0m2.086suser 0m0.180ssys 0m0.300s[[email protected]:d IRS] Timereal 0m0.000suser 0m0.000ssys 0m0.000s
Shell Text Processing