CMIS 325
Day 9 grep mostly
Name:______________
Using the 'japan' file:
How many lines contain a p?
How many lines contain a pa?
How many lines contain a pap?
How many lines contain a papa?
What are the line numbers of the lines containing a papa?
In the 'rime' file:
How many lines have the string ice?
How many lines have the word ice?
How many lines have the string ice, regardless of case?
How many lines have "and the".
What are their line numbers?
How many lines don't contain a space (these will probably be empty lines)?
In the weblog file:
How many different files were requested:__________________
What is the largest gif file that was accessed:___________
Command line used:___________________________________________
What are the different status codes (9th field):
Command line used:___________________________________________
In the 'alice' file: (single-quote these punctuation symbols
will avoid shell interpretation of them).
Mostly use tr:
How many periods are there:_______
How many question marks are there:_______
How many exclamation marks are there:_______
Summing these, we can guess the number of sentences:_________
How many commas are there:_______
How many colons are there:_______
How many semicolons are there:_______
How many single-quotes ('apostrophes') are there:_______
How many double-quotes ("quotation marks"):_________
Halving, we can guess how many utterances there are:_______
How many left parentheses are there:_______
How many right parentheses are there:_______
What other punctuation symbols are in the file:____________
grep:
How many lines contain Alice:______
How many lines contain ALICE:______
How many lines contain alice:______
How many lines contain alice in any mix of case:______
In the 'country.txt' file:
How many countries in the continent of Africa:___________
What is the population of the second-most populated African country:________
(population is the 7th field of the file)
Make a command line that will count the number of 2-letter country codes
that start with an F:________________________________________________________