{"id":163,"date":"2026-04-19T10:27:03","date_gmt":"2026-04-19T09:27:03","guid":{"rendered":"https:\/\/vpp.dk\/?linux_trick=find-and-kill-a-process-by-name"},"modified":"2026-04-19T10:27:03","modified_gmt":"2026-04-19T09:27:03","slug":"find-and-kill-a-process-by-name","status":"publish","type":"linux_trick","link":"https:\/\/vpp.dk\/?linux_trick=find-and-kill-a-process-by-name","title":{"rendered":"Find and kill a process by name"},"content":{"rendered":"<p>Quickly find the PID of a running process and kill it \u2014 no need to first run ps and note the ID manually.<\/p>\n","protected":false},"template":"","meta":{"_trick_code":"kill $(pgrep -f process_name)\n\n# Or with a signal:\nkill -9 $(pgrep -f process_name)","_trick_uploader":"lars"},"trick_category":[18],"class_list":["post-163","linux_trick","type-linux_trick","status-publish","hentry","trick_category-process-management"],"_links":{"self":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/linux_trick"}],"about":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=\/wp\/v2\/types\/linux_trick"}],"wp:attachment":[{"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"trick_category","embeddable":true,"href":"https:\/\/vpp.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftrick_category&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}