CMIS 325
Day 7
Name:__________________________
Practice with tr (and maybe friends, in pipelines):
Using the 'alice' file
How many lines, words, characters are there?
Strip out all but letters. How many lines, words, chars are there?
How many of the chars are letters?
Using the mathematical operation of subtraction, how many of the
characters of the file are not letter? (hint: use your 'calc' function)
Strip all but letters, spaces and newlines. How many lines, words and
characters?
Strip all but the spaces. How many spaces are there?
What percentage of the file is spaces (hint: divide the number of
spaces by the total number of chars)?
Strip all but the newlines. How many newlines are there?
What percentage of the file is newlines? (hint: see previous question)
Make all letters lowercase. How many lines, words, characters are there?
Make the contents of the lowercased alice file one word per line,
with no punctuation and no blank lines.
How many lines, words, characters?
(number of lines will be same as the number of words)
What is the last of those words in sorted order?
How many different words are there? (hint: -u of sort)
What is the length of the longest word? (hint: -L of wc)
Using the commands learned so far.
Using the 'japan.txt' file on the class web site.
What kind of file is it?
How many lines, words, characters are there?
What are the whitespace characters between the fields?
How many disk blocks are allocated to it?
What is first field value that is first in alphabetical order?
What is last field value that is last in alphabetical order?
What is the largest value of the third field?