I’ve been setting up a new Proxmox server and messing around with VMs, and wanted to know what kind of useful commands I’m missing out on. Bonus points for a little explainer.

Journalctl | grep -C 10 'foo' was useful for me when I needed to troubleshoot some fstab mount fuckery on boot. It pipes Journalctl (boot logs) into grep to find ‘foo’, and prints 10 lines before and after each instance of ‘foo’.

  • Gary Ghost@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 hours ago

    ps -ef | grep <process_name

    Kill -9 proces id

    I googled that -15 is better, I forgot what -9 even did, been using it for years.

    • black0ut@pawb.social
      link
      fedilink
      arrow-up
      2
      ·
      6 hours ago

      The number is the signal you send to the program. There’s a lot of signals you can send (not just 15 and 9).

      The difference between them is that 15 (called SIGTERM) tells the program to terminate by itself (so it can store its cached data, create a save without losing data or corrupting, drop all its open connections gracefully, etc). 9 (called SYGKILL) will forcefully kill a program, without waiting for it to properly close.

      You normally should send signal 15 to a program, to tell it to stop. If the program is frozen and it’s not responding or stopping, you then send signal 9 and forcefully kill it. No signal is “better” than the other, they just have different usecases.