To do the sorting: % sort sorts the input alphanumerically % sort -n sorts the input numerically % sort -k1,1n sorts using the first field numerically % sort -k2,2nr sorts using the second field numerically, reversed To use grep for the questions: % grep -n “Martin” greps for the string Martin, shows line numbers % egrep -n “<.*>” greps for HTML tags, shows line numbers