From ba5da471c1f724722fa1ac52f0f327bfd7f09ea8 Mon Sep 17 00:00:00 2001 From: Jesse Johnston Date: Sat, 19 Sep 2026 12:05:47 -0400 Subject: [PATCH 1/4] Clarify faded example challenge text and the output of the first code example --- episodes/05-counting-mining.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/episodes/05-counting-mining.md b/episodes/05-counting-mining.md index 06433a97..c119ade3 100644 --- a/episodes/05-counting-mining.md +++ b/episodes/05-counting-mining.md @@ -249,10 +249,14 @@ $ wc -l *.tsv | sort -n | head -n 1 | cat ## Count the number of words, sort and print (faded example) -To count the total lines in every `tsv` file, sort the results and then print the first line of the file we use the following: +The following commands count the total lines in every `tsv` file, sort the results from smallest to largest (based on the first value in the line), then print the first line of the results to the display, thus showing the `tsv` file with the fewest lines: ```bash -wc -l *.tsv | sort -n | head -n 1 +$ wc -l *.tsv | sort -n | head -n 1 +``` + +```output + 5375 2014-02-02_JA-britain.tsv ``` Now let's change the scenario. We want to know the 10 files that contain *the most* words. Check the manual for the `wc` command (either using `man wc` or `wc --help`) to see if you can find out what flag to use to print out the number of words (but not the number of lines and bytes). Fill in the blanks below to count the words for each file, put them into order, and then make an output of the 10 files with the most words (Hint: The sort command sorts in ascending order by default). From 991a0b85086622cce3b9e064ac5dcb8b2bfcf1a8 Mon Sep 17 00:00:00 2001 From: Jesse Johnston Date: Sat, 19 Sep 2026 12:08:18 -0400 Subject: [PATCH 2/4] clarify faded example opening text (to link directly to previous demo) --- episodes/05-counting-mining.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/05-counting-mining.md b/episodes/05-counting-mining.md index c119ade3..67cce066 100644 --- a/episodes/05-counting-mining.md +++ b/episodes/05-counting-mining.md @@ -249,7 +249,7 @@ $ wc -l *.tsv | sort -n | head -n 1 | cat ## Count the number of words, sort and print (faded example) -The following commands count the total lines in every `tsv` file, sort the results from smallest to largest (based on the first value in the line), then print the first line of the results to the display, thus showing the `tsv` file with the fewest lines: +As demonstrated above, the following commands pipe data from one to antoher to count the total lines in every `tsv` file, sort the results from smallest to largest (based on the first value in the line), then print the first line of the results to the display, thus showing the `tsv` file with the fewest lines: ```bash $ wc -l *.tsv | sort -n | head -n 1 From 2799a6ebe22ed02473a2c8111605101b68e1ea9b Mon Sep 17 00:00:00 2001 From: Jesse Johnston Date: Sat, 19 Sep 2026 12:14:21 -0400 Subject: [PATCH 3/4] clarify the faded example question text --- episodes/05-counting-mining.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/05-counting-mining.md b/episodes/05-counting-mining.md index 67cce066..15da6a8a 100644 --- a/episodes/05-counting-mining.md +++ b/episodes/05-counting-mining.md @@ -259,7 +259,7 @@ $ wc -l *.tsv | sort -n | head -n 1 5375 2014-02-02_JA-britain.tsv ``` -Now let's change the scenario. We want to know the 10 files that contain *the most* words. Check the manual for the `wc` command (either using `man wc` or `wc --help`) to see if you can find out what flag to use to print out the number of words (but not the number of lines and bytes). Fill in the blanks below to count the words for each file, put them into order, and then make an output of the 10 files with the most words (Hint: The sort command sorts in ascending order by default). +Now, let's change the scenario: instead of the number of lines in the files, which files contain the most *words*? Fill in the blanks below with the appropriate flags and commands so that the command pipeline will return the 10 files ordered from the lowest to highest word count. Check the manual for the `wc` command (either using `man wc` or `wc --help`) to see if you can find out what flag to use to print out the number of words (but not the number of lines and bytes). Fill in the blanks below to count the words for each file, put them into order, and then make an output of the 10 files with the most words (Hint: The sort command sorts in ascending order by default). ```bash wc __ *.tsv | sort __ | ____ From 65044a7eb922ca4cd70d2bbc0d26c2ad2570c679 Mon Sep 17 00:00:00 2001 From: Jesse Johnston Date: Sat, 19 Sep 2026 12:15:25 -0400 Subject: [PATCH 4/4] add fuller explanation of the faded example solution --- episodes/05-counting-mining.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/05-counting-mining.md b/episodes/05-counting-mining.md index 15da6a8a..c9c75d83 100644 --- a/episodes/05-counting-mining.md +++ b/episodes/05-counting-mining.md @@ -269,7 +269,7 @@ wc __ *.tsv | sort __ | ____ ## Solution -Here we use the `wc` command with the `-w` (word) flag on all `tsv` files, `sort` them and then output the last 11 lines (10 files and the total) using the `tail` command. +Here we use the `wc` command with the `-w` (word) flag on all `tsv` files, `sort` them (in ascending order), and then output the last 11 lines (10 files and the total) using the `tail` command with the `-n 11` flag. ```bash wc -w *.tsv | sort -n | tail -n 11