Kill a process group
Send SIGTERM to the whole process group of my-app.
kill -TERM -$(pgrep -f 'my-app')
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.shRun 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 nginxShow 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 trackingShow clock sync state, time offset and NTP source details.