This can be done either with a local installation or remote connection over ssh.
- man
- apropos (man -k)
- history/up/tab/ctrl-R/!!/../~
- clear/reset/less
- cd/ls/pwd/mkdir/rm/rmdir/touch/vi (with a file browser open)
- bc
- date
- cal
- lynx/links/w3m
- cowsay/fortune as fun extras
- ssh
- scp/sftp
- top
Explain the inspirations for command line piping, "the UNIX philosophy", and introduce Jon Bentley's challenge.
- dmesg/echo - text source
- cut
- sort
- uniq
- tr
- wc
- grep
- less/more
- head/tail
This probably should include an explanation of stderr vs stdout, but hasn’t yet.
- cat
- > and <
curl -o shakespeare.txt http://www.gutenberg.org/files/100/100.txt
cat shakespeare.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed 1q
- Pipe works of Shakespeare
- Convert all non-alpha characters to newlines, then squeeze each string of repeated newlines into a single newline
- Transform upper to lowercase
- Sort by alpha
- Print only unique lines with a count of duplicates
- Reverse numeric sort
- Print only 1 line
cat shakespeare.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | awk -- 'prev!="" { print prev,$0; } { prev=$0; }' | sort | uniq -c | sort -rn | sed 1q
cat shakespeare.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | awk -- 'first!=""&&second!="" { print first,second,$0; } { first=second; second=$0; }' | sort | uniq -c | sort -rn | sed 1q
- seq
- for/do/done
- if/then/elif/fi
- integration.sh
This was a last minute hack and needs refinement.
seq 1 500 50000 | tr '\n' ' ' | xargs -n3 echo | column -t
- Generate 1-50000, every 500th
- Transform newline to space
- Echo three rows at a time
- Have column align columns
seq 1 500 50000 | tr '\n' ' ' | xargs -n4 echo | tr ' ' ',' | column -t -s,
- Generate 1-50000, every 500th
- Transform newline to space
- Echo four rows at a time
- Transform space to comma
- Have column break on comma and align columns