compsci-missing_semester_2020/_subsections/lesson-04.org

3.5 KiB

Lesson 04 | Data Wrangling

notes

intro example

  • using ssh someserver 'somecommand' will run that command on the server
  • you could run a series of commands on the server instead of channeling all that info back

    ssh someserver 'journalctl | grep sshd | grep "Disconnected from"' | less
  • this will run journalctl on the server, find anything that says 'sshd' and 'disconnec..' in the results
  • then send all those results back to our machine where we pipe it through 'less'

SED

  • stream editor
  • allows you to make changes to the contents of a stream
  • full programming langauge
  • common task is to run replacement expressions on an input stream

example

sed 's/.*blahblah blah//'
  • uses regular expressions

    • way of matching text