Show all listening services with their systemd unit.
IntermediateProductionRapid-Fire Commands
Answer
for pid in $(sudo ss -tlnpH | grep -oP 'pid=\K[0-9]+' | sort -u); do
printf '%s %s\n' "$pid" "$(ps -o unit= -p "$pid")"
done
ps -o unit= prints the systemd unit owning a PID.
More on Rapid-Fire Commands
Which process is listening on port 8080?BeginnerShow the top 10 memory-consuming processes.BeginnerFind files larger than 1 GiB on the root filesystem only.BeginnerShow failed systemd units.BeginnerShow the last 10 reboots and shutdowns.BeginnerShow failed SSH login attempts by source IP.Intermediate