CMIT 391 Name:__________________ With the weblog file: Using grep family only: (pipes of them OK) How many hits were to rharris or dwills:_______ How many hits are from the 131 network (i.e. start with 131):______ How many hits are for neither GIFs nor JPGs (either case):________ How many hits in the first minute after midnight of 27 June:________ How many 206 status codes (second to last field) are there:__________ How many requests were HTTP/1.0:________ How many requests were HTTP/1.1:________ Using whatever: How many different pages were hit:________ What are the status codes (second to last field) that are used:_________________ How many times is each status code used:________________________________ hint: pipe the sorted list of status codes into this to get a frequency count: awk '{a[$1]++} END {for(n in a) print n,a[n]}' Which page was hit the most number of times:_____________________________ With the city.txt file: Format is: key,'name','country code','state',population Using whatever What does the file command indicate city.txt is:_________________________ How many lines and words, according to wc:_____________________ What else does wc indicate (i.e. the errors):_____________________________________________ Are there undisplayable (on your terminal) characters:__________ How are they displayed:___________________ How does od -c indicate the weird characters of record 45:______________________ Load the file into gedit. How are the weird characters of record 45 displayed:________________ How are the weird characters of record 61 displayed:________________ See if you can change the Terminal Character Encoding to Western (Windows 1252):_______ (it's a Microsoft-only encoding) Now how about the weird characters:_________ How many cities are in BRAzil:___________ What is the total population of those cities:_________ hint: pipe the city sizes into: awk '{t+=$1}END {print t}' How many different "countries" are in the file:____________ What is the largest city in China and what is its population:_____________________ What is the largest city in the world and what is its population:_____________________ How many lines contain a parenthesis:________ What are the extended-ASCII characters:____________________________ hint: sed 's/./&\n/g' will output its input one character per line What is the length of the longest city name:_____ How many "countries" have only one city:_____________ hint: use the frequency count SKIP: What cities have the same name as their state: sort by country, state, city