Kill a process group

Send SIGTERM to the whole process group of my-app.

kill -TERM -$(pgrep -f 'my-app')

tool
linux133 commands
tags
linux

More linux commands

  • renice -n 10 -p <pid>

    Lower the priority of a running process (nice +10).

  • systemd-run --scope -p MemoryMax=512M -p CPUQuota=50% -- ./heavy.sh

    Run a command in a temporary systemd scope with limits of 512M memory and 50% CPU.

  • journalctl --since '2024-01-15 10:00' --until '2024-01-15 10:30' -u nginx

    Show nginx logs between two points in time.

  • journalctl -u <service> -o json | jq '{ts: .REALTIME_TIMESTAMP, msg: .MESSAGE}'

    Export logs as structured JSON (time and message), for example to send them to a log aggregator.

  • timedatectl status && chronyc tracking

    Show clock sync state, time offset and NTP source details.

all 133 linux commands