name: inverse layout: true class: center, middle, inverse --- # Standard Input/Output and Intro to Text Processing From terminals, via pipes, to processing actual text .footnote[Marek Šuppa
Ondrej Jariabka
Adrián Matejov] --- layout: false # Why UNIX-like for Data Science? -- It teaches you the [Unix philosophy](http://catb.org/esr/writings/taoup/html/ch01s06.html), which is to - Write programs that do one thing and do it well - Write programs to work together - Write programs to handle text streams, because that is a universal interface .quote_author[*-- [Doug McIlroy](https://en.wikipedia.org/wiki/Douglas_McIlroy), creator of Unix pipes*] -- Or in other words .center[**[KISS](https://en.wikipedia.org/wiki/KISS_principle): Keep It Simple, Stupid**] --- # Input / Output in Computing History ![:scale 80%](images/teletype.jpg) ??? - Standardizing input/output has been a big breakthrough of UNIX - Unline in previous systems, the input/output devices have been **abstracted** - Plus the programmer needed to do absolutelly nothing to have some standard input/output set up for their program --- class: center # Input / Output Abstracted ![:scale 80%](images/1920px-Stdstreams-notitle.svg.png) .font-small[[The standard streams for input, output and error](https://en.wikipedia.org/wiki/Standard_streams#/media/File:Stdstreams-notitle.svg)] ??? - Standard error was added to Unix in the 1970s after several wasted phototypesetting runs ended with error messages being typeset instead of displayed on the user's terminal --- # Standard Input Output By default, any process (command/application) has access to: - `stdin` (**0**): standard input (keyboard) - `stdout` (**1**): standard output (terminal) - `stderr` (**2**): standard error (terminal) Also referred to as "**standard I/O streams**". -- .left-eq-column[ From the point of view of the process, these are files like any other. Represented by "file descriptors" (IDs) **0**, **1** and **2**. By default, they are all connected to the terminal. ] .right-eq-column[ [![](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3RkaW4gLS0tPiB0ZXJtaW4oXCIvZGV2L3R0eTBcIilcbiAgICBzdGRvdXQgLS0tPiB0ZXJtb3V0KFwiL2Rldi90dHkwXCIpXG4gICAgc3RkZXJyIC0tLT4gdGVybWVycihcIi9kZXYvdHR5MFwiKSIsIm1lcm1ha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jUwMDAwMDAwMSwgNC4yNTAwMDAwMDAxLCA0LjI1MDAwMDAwMDEpIiwiY2xhc3NUZXh0IjoiIzMzMyIsImZpbGxUeXBlMCI6IiNmZmY0ZGQiLCJmaWxsVHlwZTEiOiJoc2woLTc5LjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlMiI6ImhzbCgxMDQuNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGUzIjoiaHNsKC0xNS40MTE3NjQ3MDU5LCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTQiOiJoc2woLTIzLjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlNSI6ImhzbCgtMTQzLjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlNiI6ImhzbCgxNjguNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU3IjoiaHNsKDQ4LjU4ODIzNTI5NDEsIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSJ9fSwidXBkYXRlRWRpdG9yIjpmYWxzZX0) ] --- # Useful Stream I/O commands - `echo string` - Outputs all of its (string) arguments to `stdout` ```bash $ echo Hello Hello ``` ```bash $ echo "Hi there" Hi there ``` -- - `cat FILE` - Outputs the contents of `FILE` to `stdout` - When no `FILE` is specified (or when `FILE` is `-`), read `stdin` ```bash $ cat text.txt This is a sample text from the text.txt file. ``` ```bash $ cat Hi Hi there! there! ``` --- # Stream Redirection: Output .left-eq-column[ - `command > file.txt` - the standard output of `command` will be **redirected** to `file.txt` ```bash $ echo Hello > output.txt $ cat output.txt Hello $ cat output.txt > file.txt $ cat file.txt Hello ``` ] .right-eq-column[ .center[ [![:scale 50%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGR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mtDb2xvciI6IiMzMzMiLCJ0YXNrVGV4dENsaWNrYWJsZUNvbG9yIjoiIzAwMzE2MyIsImxhYmVsQ29sb3IiOiIjMzMzIiwiYWx0QmFja2dyb3VuZCI6ImhzbCgyMjAuNTg4MjM1Mjk0MSwgMTAwJSwgOTguMzMzMzMzMzMzMyUpIiwiZXJyb3JCa2dDb2xvciI6ImhzbCgyMjAuNTg4MjM1Mjk0MSwgMTAwJSwgOTguMzMzMzMzMzMzMyUpIiwiZXJyb3JUZXh0Q29sb3IiOiJyZ2IoNC4yNTAwMDAwMDAxLCA0LjI1MDAwMDAwMDEsIDQuMjUwMDAwMDAwMSkiLCJjbGFzc1RleHQiOiIjMzMzIiwiZmlsbFR5cGUwIjoiI2ZmZjRkZCIsImZpbGxUeXBlMSI6ImhzbCgtNzkuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGUyIjoiaHNsKDEwNC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTMiOiJoc2woLTE1LjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlNCI6ImhzbCgtMjMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU1IjoiaHNsKC0xNDMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU2IjoiaHNsKDE2OC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTciOiJoc2woNDguNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIn19LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ) ] ] -- .clear-both[ .left-eq-column[ - `command >> file.txt` - the standard output of `command` will be **appended** to `file.txt` ```bash $ echo Hi > output.txt $ echo there! >> output.txt $ cat output.txt Hi there! ``` ] .right-eq-column[ .font-small[Note that `>` overrides the contents of the file -- anything that was in it will be .red[removed].] ] ] --- # Stream Redirection: Input .left-eq-column[ - `command < file.txt` - the input to `command` will come from `file.txt` ``` $ echo Hello > file.txt $ cat < file.txt Hello ``` ] .right-et-column[ .center[ [![:scale 25%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3RkaW4gLS0tPiB0ZXJtaW4oXCJmaWxlLnR4dFwiKVxuICAgIHN0ZG91dCAtLS0-IHRlcm1vdXQoXCIvZGV2L3R0eTBcIilcbiAgICBzdGRlcnIgLS0tPiB0ZXJtZXJyKFwiL2Rldi90dHkwXCIpIiwibWVybWFpZCI6eyJ0aGVtZSI6ImJhc2UiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoiI2Y0ZjRmNCIsImRhcmtNb2RlIjpmYWxzZSwicHJpbWFyeUNvbG9yIjoiI2ZmZjRkZCIsIm5vdGVCa2dDb2xvciI6IiNmZmY1YWQiLCJub3RlVGV4dENvbG9yIjoiIzMzMyIsImZvbnRGYW1pbHkiOiJcInRyZWJ1Y2hldCBtc1wiLCB2ZXJkYW5hLCBhcmlhbCIsImZvbnRTaXplIjoiMTZweCIsInByaW1hcnlUZXh0Q29sb3IiOiIjMzMzIiwic2Vjb25kYXJ5Q29sb3IiOiJoc2woLTc5LjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsInRlcnRpYXJ5Q29sb3IiOiJoc2woMjIwLjU4ODIzNTI5NDEsIDEwMCUsIDk4LjMzMzMzMzMzMzMlKSIsInByaW1hcnlCb3JkZXJDb2xvciI6ImhzbCg0MC41ODgyMzUyOTQxLCA2MCUsIDgzLjMzMzMzMzMzMzMlKSIsInNlY29uZGFyeUJvcmRlckNvbG9yIjoiaHNsKC03OS40MTE3NjQ3MDU5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MzMzMzMzMzJSkiLCJmaWxsVHlwZTciOiJoc2woNDguNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIn19LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ) ] ] --- # Stream Redirection: (Error) Output .left-eq-column[ - Standard I/O can also be referenced via numbers - **0** for in, **1** for out, **2** for err - For instance, the following sends the error output to `/dev/null` ```bash $ pip install somepackage 2> /dev/null ``` ] .right-eq-column[ .center[ [![:scale 50%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3RkaW4gLS0tPiB0ZXJtaW4oXCIvZGV2L3R0eTBcIilcbiAgICBzdGRvdXQgLS0tPiB0ZXJtb3V0KFwiL2Rldi90dHkwXCIpXG4gICAgc3RkZXJyIC0tLT4gdGVybWVycihcIi9kZXYvbnVsbFwiKSIsIm1lcm1haWQiOnsidGhlbWUiOiJiYXNlIiwidGhlbWVWYXJpYWJsZXMiOnsiYmFja2dyb3VuZCI6IiNmNGY0ZjQiLCJkYXJrTW9kZSI6ZmFsc2UsInByaW1hcnlDb2xvciI6IiNmZmY0ZGQiLCJub3RlQmtnQ29sb3IiOiIjZmZmNWFkIiwibm90ZVRleHRDb2xvciI6IiMzMzMiLCJmb250RmFtaWx5IjoiXCJ0cmVidWNoZXQgbXNcIiwgdmVyZGFuYSwgYXJpYWwiLCJmb250U2l6ZSI6IjE2cHgiLCJwcmltYXJ5VGV4dENvbG9yIjoiIzMzMyIsInNlY29uZGFyeUNvbG9yIjoiaHNsKC03OS40MTE3NjQ3MDU5LCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJ0ZXJ0aWFyeUNvbG9yIjoiaHNsKDIyMC41ODgyMzUyOTQxLCAxMDAlLCA5OC4zMzMzMzMzMzMzJSkiLCJwcmltYXJ5Qm9yZGVyQ29sb3IiOiJoc2woNDAuNTg4MjM1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gMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU3IjoiaHNsKDQ4LjU4ODIzNTI5NDEsIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSJ9fSwidXBkYXRlRWRpdG9yIjpmYWxzZX0) ] ] -- .clear-both[ - it is possible to combine multiple redirections in the same command - the following forwards the `stdout` to `output.log` and `stderr` to `error.log` ```bash $ pip install unknownpkg 1> output.log 2> error.log ``` .center[ [![](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggVEJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3RkaW4gLS0-IHRlcm1pbihcIi9kZXYvdHR5MFwiKVxuICAgIHN0ZG91dCAtLT4gdGVybW91dChcIm91dHB1dC5sb2dcIilcbiAgICBzdGRlcnIgLS0-IHRlcm1lcnIoXCJlcnJvci5sb2dcIikiLCJtZXJtYWlkIjp7InRoZW1lIjoiYmFzZSIsInRoZW1lVmFyaWFibGVzIjp7ImJhY2tncm91bmQiOiIjZjRmNGY0IiwiZGFya01vZGUiOmZhbHNlLCJwcmltYXJ5Q29sb3IiOiIjZmZmNGRkIiwibm90ZUJrZ0NvbG9yIjoiI2ZmZjVhZCIsIm5vdGVUZXh0Q29sb3IiOiIjMzMzIiwiZm9udEZhbWlseSI6IlwidHJlYnVjaGV0IG1zXCIsIHZlcmRhbmEsIGFyaWFsIiwiZm9udFNpemUiOiIxNnB4IiwicHJpbWFyeVRleHRDb2xvciI6IiMzMzMiLCJzZWNvbmRhcnlDb2xvciI6ImhzbCgtNzkuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwidGVydGlhcnlDb2xvciI6ImhzbCgyMjAuNTg4MjM1Mjk0MSwgMTAwJSwgOTguMzMzMzMzMzMzMyUpIiwicHJpbWFyeUJvcmRlckNvbG9yIjoiaHNsKDQwLjU4ODIzNTI5NDEsIDYwJSwgODMuMzMzMzMzMzMzMy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KSIsImZpbGxUeXBlNyI6ImhzbCg0OC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkifX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9) ] ] --- # Stream Redirection: (Error) Output II .left-eq-column[ - `stdout` and `stderr` can be combined into the same file using `&>` ```bash $ pip install somepkg &> errout.txt ``` ] .right-eq-column[ .center[ [![:scale 50%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3RkaW4gLS0tPiB0ZXJtaW4oXCIvZGV2L3R0eTBcIilcbiAgICBzdGRvdXQgLS0tPiB0ZXJtb3V0KFwiL2Rldi9udWxsXCIpXG4gICAgc3RkZXJyIC0tLT4gdGVybW91dCIsIm1lcm1haWQiOnsidGhlbWUiOiJiYXNlIiwidGhlbWVWYXJpYWJsZXMiOnsiYmFja2dyb3VuZCI6IiNmNGY0ZjQiLCJkYXJrTW9kZSI6ZmFsc2UsInByaW1hcnlDb2xvciI6IiNmZmY0ZGQiLCJub3RlQmtnQ29sb3IiOiIjZmZmNWFkIiwibm90ZVRleHRDb2xvciI6IiMzMzMiLCJmb250RmFtaWx5IjoiXCJ0cmVidWNoZXQgbXNcIiwgdmVyZGFuYSwgYXJpYWwiLCJmb250U2l6ZSI6IjE2cHgiLCJwcmltYXJ5VGV4dENvbG9yIjoiIzMzMyIsInNlY29uZGFyeUNvbG9yIjoiaHNsKC03OS40MTE3NjQ3MDU5LCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJ0ZXJ0aWFyeUNvbG9yIjoiaHNsKDIyMC41ODgyMzUyOTQxLCAxMDAlLCA5OC4zMzMzMzMzMzMzJSkiLCJwcmltYXJ5Qm9yZGVyQ29sb3IiOiJoc2woNDAuNTg4MjM1Mjk0MSwgNjAlLCA4My4zMzMzMzMzMzMzJSkiLCJzZWNvbmRhcnlCb3JkZXJDb2xv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DkzLjMzMzMzMzMzMzMlKSJ9fSwidXBkYXRlRWRpdG9yIjpmYWxzZX0) ] ] --- # Pipes .font-small[ .center[*Perhaps the single most striking invention in Unix* ([source](https://toroid.org/unix-pipe-implementation))] ] - A simple way of forwarding the `stdout` from one command to the `stdin` of another one. - The image below represents the following call (the pipe is denoted **`|`**): ```bash $ command1 | command2 ``` -- .center[ [![:scale 80%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0ZG91dCgxKVxuICAgIHN0ZGVycigyKVxuXG4gICAgc3ViZ3JhcGggY29tbWFuZDFcbiAgICBzdGRpbiAtLS0-IHRlcm1pbihcIi9kZXYvdHR5MFwiKVxuICAgIHN0ZG91dCAtLS0-IHRlcm1vdXRbXCJwaXBlICh3cml0ZSlcIl1cbiAgICBzdGRlcnIgLS0tPiB0ZXJtZXJyKFwiL2Rldi90dHkwXCIpXG4gICAgZW5kXG5cbiAgICBzdGRpbjIoMClcbiAgICBzdGRvdXQyKDEpXG4gICAgc3RkZXJyMigyKVxuXG4gICAgc3ViZ3JhcGggY29tbWFuZDJcbiAgICBzdGRpbjIgLS0tPiB0ZXJtaW4yW1wicGlwZSAocmVhZClcIl1cbiAgICBzdGRvdXQyIC0tLT4gdGVybW91dDIoXCIvZGV2L3R0eTBcIilcbiAgICBzdGRlcnIyIC0tLT4gdGVybWVycjIoXCIvZGV2L3R0eTBcIilcbiAgICBlbmRcblxuICAgIHRlcm1vdXQgLS0gcGlwZSAtLT4gc3RkaW4yIiwibWVybWFpZCI6eyJ0aGVtZSI6ImJhc2UiLCJ0aGVtZVZhcmlhYmxlcyI6eyJiYWNrZ3JvdW5kIjoiI2Y0ZjRmNCIsImRhcmtNb2RlIjpmYWxzZSwicHJpbWFyeUNvbG9yIjoiI2ZmZjRkZCIsIm5vdGVCa2dDb2xvciI6IiNmZmY1YWQiLCJub3RlVGV4dENvbG9yIjoiIzMzMyIsImZvbnRGYW1pbHkiOiJc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iOiIjMzMzIiwiYWx0QmFja2dyb3VuZCI6ImhzbCgyMjAuNTg4MjM1Mjk0MSwgMTAwJSwgOTguMzMzMzMzMzMzMyUpIiwiZXJyb3JCa2dDb2xvciI6ImhzbCgyMjAuNTg4MjM1Mjk0MSwgMTAwJSwgOTguMzMzMzMzMzMzMyUpIiwiZXJyb3JUZXh0Q29sb3IiOiJyZ2IoNC4yNTAwMDAwMDAxLCA0LjI1MDAwMDAwMDEsIDQuMjUwMDAwMDAwMSkiLCJjbGFzc1RleHQiOiIjMzMzIiwiZmlsbFR5cGUwIjoiI2ZmZjRkZCIsImZpbGxUeXBlMSI6ImhzbCgtNzkuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGUyIjoiaHNsKDEwNC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTMiOiJoc2woLTE1LjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlNCI6ImhzbCgtMjMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU1IjoiaHNsKC0xNDMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU2IjoiaHNsKDE2OC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTciOiJoc2woNDguNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIn19LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ) ] --- # Pipes II - Similarly to `&>`, there exists a way of sending both the `stdout` and `stderr` to the `stdin` of another process - This is done via the `|&` shortcut (not used that much in practice though) ```bash $ command1 |& command2 ``` -- .center[ [![:scale 70%](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBzdGRpbigwKVxuICAgIHN0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mZjRkZCIsImZpbGxUeXBlMSI6ImhzbCgtNzkuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGUyIjoiaHNsKDEwNC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTMiOiJoc2woLTE1LjQxMTc2NDcwNTksIDEwMCUsIDkzLjMzMzMzMzMzMzMlKSIsImZpbGxUeXBlNCI6ImhzbCgtMjMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU1IjoiaHNsKC0xNDMuNDExNzY0NzA1OSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIiwiZmlsbFR5cGU2IjoiaHNsKDE2OC41ODgyMzUyOTQxLCAxMDAlLCA5My4zMzMzMzMzMzMzJSkiLCJmaWxsVHlwZTciOiJoc2woNDguNTg4MjM1Mjk0MSwgMTAwJSwgOTMuMzMzMzMzMzMzMyUpIn19LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ) ] --- class: middle, inverse # Text processing utilities --- # `head` and `tail` .left-eq-column[ - `head` - outputs the first (by defaut 10) lines of the file - `-n k` only outputs the first `k` lines - `-n -k` outputs all but the last `k` lines - `tail` - outputs the last (by defaut 10) lines of the file - `-n k` only outputs the last `k` lines - `-n +k` outputs all but the first `k` lines - `-f` output appends as the file grows ] .right-eq-column[ ```bash $ cat file.txt 1 Adam 2 Beatrice 3 Cynthia 4 David 5 Emma $ head -n 3 file.txt 1 Adam 2 Beatrice 3 Cynthia $ head -n -3 file.txt 1 Adam 2 Beatrice $ tail -n 3 file.txt 3 Cynthia 4 David 5 Emma $ tail -n +4 file.txt 4 David 5 Emma ``` ] --- # `sort` .left-eq-column[ - sorts the input (file or stream of characters) - `-r` prints the sorted lines in **r**everse - `-n` makes the sorting **n**umeric - `-k m` sort by column `m` (set sort **k**ey) ```bash $ sort -k 2 file.txt 13 Adam 02 Beatrice 3 Cynthia -4 David 5 Emma ``` ] .right-eq-column[ ```bash $ cat file.txt 02 Beatrice 5 Emma -4 David 3 Cynthia 13 Adam $ sort file.txt 02 Beatrice 13 Adam 3 Cynthia -4 David 5 Emma $ sort -r file.txt 5 Emma -4 David 3 Cynthia 13 Adam 02 Beatrice $ sort -n file.txt -4 David 02 Beatrice 3 Cynthia 5 Emma 13 Adam ``` ] --- # `uniq` .left-eq-column[ - removes the duplicate lines - provided that they are already sorted alphabetically - `-d` only outputs **d**uplicates - `-u` only outputs **u**nique lines (those without duplicates) - `-i` makes the comparison case-**i**nsensitive - `-c` prints out the number of repetitions ] .right-eq-column[ ```bash $ cat file.txt Amy Amy Bob Carol Carol Carol $ uniq file.txt Amy Bob Carol $ uniq -d file.txt Amy Carol $ uniq -u file.txt Bob $ uniq -c file.txt 2 Amy 1 Bob 3 Carol ``` ] --- # `sort` + `uniq` == strong combo - Suppose we are given the following task: - **Input**: A list of users who tried to log in with the wrong password. Each line corresponds to one attempt. - **Output**: A list of users sorted by their number of unsuccessful login attempts, from most to least. -- .left-eq-smaller-column[ ```bash $ cat attempts.txt joe lena joe joe garfield lena woe garfield $ cat attempts.txt | sort garfield garfield joe joe joe lena lena woe ``` ] .right-eq-larger-column[ ```bash $ cat attempts.txt | sort | uniq -c 2 garfield 3 joe 2 lena 1 woe $ cat attempts.txt | sort | uniq -c | sort 1 woe 2 garfield 2 lena 3 joe $ cat attempts.txt | sort | uniq -c | sort -r 3 joe 2 lena 2 garfield 1 woe ``` ] --- # `tr` - the standard usage is `tr [SET1] [SET2]` - translate from one set of characters (`[SET1]`) to the other (`[SET2]`) - the sets (which need to be of the same size) can be defined as - explicit list of characters (`abcdef`) - implicit list of characters (`a-z`, `A-Z` or `0-9`) - named groups like `[:digit:]` (all digits), `[:alpha:]` (all letters) or `[:lower:]` and `[:upper:]` (lower and upper case letters) ```bash $ echo "Hi There" | tr abcdef ABCDEF Hi ThErE $ echo "Hi There" | tr a-z A-Z HI THERE $ echo "Hi There" | tr [:upper:] [:lower:] hi there ``` - `-d` removes the characters specified in `[SET1]` ```bash $ echo "Hi There" | tr -d abcdef Hi Thr ``` --- # Debugging Pipes: *per partes* - Pipes were first implemented as (temporary) files - When working on a long command with a ton of pipes, it's the best debugging option available ```bash $ cat attempts.txt | sort > file1.txt $ cat file1.txt [ ... output ommited ... ] $ cat file1.txt | uniq -c > file2.txt $ cat file2.txt [ ... output omitted ... ] $ cat file2.txt | sort -r > file3.txt $ cat file3.txt [ ... output omitted ... ] ``` -- - Once we see the commands work part-by-part (*per partes*), we can put it all together ```bash $ cat attempts.txt | sort | uniq -c | sort -r ``` ??? This is the massive advantage of having a powerful shell: - you are in an environment you know - you can interactively try stuff out (cobble it together) if you want - you very quickly see what works and what does not