Sed shares the common functions sed and awk. However, we can understand that sed performs operations on text content (Text replacement) and awk performs operations on text structure. 1. Replace zhc in the filename file with hongchangfirst and put it in filename2. Sed's/zhc/hongchangfirst 'filename> filename2 2 sed script is stored in the scriptname file. Sed-f scriptname filename 3 outputs the first and third columns in the filename file to the filename2 file awk '{print $1; print $3} 'filename> filename2 4 the default Delimiter is space. You can use-F to change it to a comma as the separator, and change it to a colon-F: awk-F, '{print $2}' filename> filename2 5 awk script is put into the scriptname file awk-f scriptname filename> filename2 sort | uniq 6 lists the 10 longest-used commands history | awk '{a [$2] ++} END {for (I in) {print a [I] "" I} '| sort-rn | head