The file hits.txt1 is a log file extracted from a web server. Each line contains four comma separated fields. The first field contains the timestamp a certain web page was requested, and the other fields are the IP address, the country and the city of the user that sent the request. You may take the assumption that city names are unique with a country, whereas different countries may have cities that share the same name.

Assignment

You are asked to complete the following pipelines so that they display meaningful information:

  1. cat hits.txt | ... | xargs echo "number of visits:"

  2. cat hits.txt | ... | xargs echo "number of different IP addresses:"

  3. cat hits.txt | ... | xargs echo "number of different countries:"

  4. cat hits.txt | ... | xargs echo "number of different cities:"

  5. cat hits.txt | ... | xargs echo "minimal number of hits per country:"

  6. cat hits.txt | ... | xargs echo "maximal number of hits per country:"

  7. cat hits.txt | ... | xargs echo "minimal number of IP addresses per country:"

  8. cat hits.txt | ... | xargs echo "maximal number of IP addresses per country:"

Make sure the correctness of these commands is guaranteed, even if additional lines are added to the file hits.txt2