Skip to content

kill

portcheck kill

Stop the process listening on a port

Synopsis

Stop the process(es) listening on the given ports, or given PIDs.

portcheck first asks the process to exit (SIGTERM) and waits for --grace before force-killing it. On Windows both steps use TerminateProcess.

You are asked for confirmation unless --yes is given; without a terminal, --yes is required. portcheck never kills PID 0/1, itself or its parent shell, and refuses well-known system processes unless --allow-system is given.

portcheck kill [port...] [flags]

Examples

  portcheck kill 3000
  portcheck kill 3000 3001 --yes
  portcheck kill --pid 4242 --force
  portcheck kill 8080 --dry-run

Options

      --allow-system     allow killing protected system processes (dangerous)
      --dry-run          show what would be killed without doing it
  -f, --force            kill immediately without a graceful request
      --grace duration   how long to wait for a graceful exit (default 5s)
  -h, --help             help for kill
      --pid int32Slice   kill these PIDs (in addition to port owners) (default [])
      --proto strings    protocols to match ports on (default [tcp,udp])
  -y, --yes              do not ask for confirmation

Options inherited from parent commands

      --json                shorthand for --output json
      --log-format string   log format: text or json (default "text")
      --no-color            disable colors (also honors NO_COLOR)
  -o, --output string       output format: table, plain, csv, json (default: table on a terminal, plain otherwise)
  -v, --verbose             log diagnostic details to stderr

SEE ALSO

  • portcheck - See what's using your ports, find free ones, and free them up