compsci-missing_semester_2020/_subsections/lesson-04.org
2025-05-14 13:43:27 +03:00

3.7 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

sed modifiers

  • (ab)* - remove zero or more of 'ab'
  • -E use new replacement
  • (ab|bc)* - remove 'ab' or 'bc'

regex debugger

  • regex101.com