Using regex search
Let's practice some common shell piping operations
- Find out the total lines in the text of "Old Man and The Sea":
wc -l oldmansea.txt
- Find out the total number of words:
wc -w oldmansea.txt
- Find out the number of unique occurrences of the word
sun
in the text:grep -o -i sun oldmansea.txt | wc -c
- What do you find out?
- Find the top ten unique words using the following command:
cat oldmansea.txt | tr " " "\n" | sort | uniq -c | sort -gr | head -10
- What did you find?
- How could you improve it?