$
학습 Linux 안내서
ko
XP:0
퀘스트 67ProcessHunter
+180 XP

Finding & Killing Processes by Name (pgrep, pkill, killall)

이 퀘스트를 위한 인터랙티브 터미널 시작→설치 불필요 • 브라우저에서 바로 실행

개념 및 개요

In fast-paced system operations, looking up process IDs with ps aux | grep name just to pass a numerical PID into kill is slow and error-prone. Linux provides process lookup and signal tools that operate directly by process name:

- pgrep : Scans active processes and returns matching PIDs. Adding -a outputs the full command line alongside the PID.
- pkill : Sends termination signals directly to all processes matching the pattern (e.g. pkill -9 miner).
- killall : Kills processes matching the exact binary executable name.

Locate the running web server processes with pgrep -a nginx, then terminate the unauthorized crypto-miner process with pkill -9 miner (or killall miner).

명령어 구문 참조

Command / SyntaxDescription
pgrep -a nginxFind process IDs and full command lines matching nginx
pkill -9 minerForcefully kill all processes matching miner
killall minerKill all processes with the exact name miner

검증 목표

  • ○
    Search for nginx processes with pgrep -a nginx
  • ○
    Kill rogue miner process with pkill -9 miner or killall miner

퀘스트를 완료할 준비가 되셨나요? 67?