compsci-missing_semester_2020/_subsections/lesson-05.org

3.3 KiB

Lesson 05 | Command line Environment

notes

topics

  • job control
  • terminal multiplexers
  • dot files / how to configure
  • work with remote machines

job control

sleep

  • puts process to sleep for a specified amount of time
  • exit by typing Ctrl-C

Ctrl-C

  • sends SIGINT - signal interrupt
  • man signal will show the list of signals

signals

SIGQUIT
signal sent when we want to quit
SIGTERM
similar to quit but not in term
SIGHUP
when we have processes running but still want to close

pausing

SIGSTOP
pause execution of program
SIGCONT
continue program

python library

  • use import signal
import signal
def handler(signum, frame):
    printf("signal received")

signal.signal(signal.SIGINT, handler)
  • the above would catch a Ctrl-C and run it through handler
  • you use this by catching a Ctrl-C and running any saves or cleanup before exiting