$30
HW 1: Coreutils
For each of the following problems, substitute the number supplied into the following instruction:
Select ____ unique coreutil commands in the slides (not already used by the other two
problems) that can be combined by piping. Construct a practical scenario where they could
be applied together, and run the command on realistic input. Include a sample of input (if
any), and the output after each pipe.
1. three
2. four
3. five
Note on commands: Scenarios which are trivial or contrived may be penalized. If you wish to use more
coreutil commands than the number specified, you are welcome to do so if no commands are repeated between problems. A command with a different flag is the same command (the count will be unchanged).
Any flags not covered in class are fair game, but the use of coreutil commands not covered in the slides is
prohibited. Partial credit will be given.
Trivial example:
touch myfile |wc
Problem: touch doesn’t even print to standard out in this case.
Contrived example:
md5sum rogue.wav | cut -f1 -d‘ ’|fold -w1 |sort | uniq
Problem: When would sorting a file’s md5sum characters be useful?
Consider that you have a lot of flexibility in the content, structure, and volume of input you might use.
For example:
• (Sequentially-named) photographs,
• plaintext sheet music,
• vocabulary words
• stock prices over time,
• a list of upcoming events,
• etc.
1