top | item 20389209

(no title)

clebio | 6 years ago

Not sure why he didn't just give us

    kill -9 $(lsof -i :19421)

discuss

order

sooheon|6 years ago

For the non bash users among us?

mkl|6 years ago

There's nothing specifically bash about it, but here's what the components mean:

"kill" = kill running process

"-9" = kill as forcefully as possible

"$(...)" = command substitution: run the stuff inside the brackets and replace this term with the results (it will be the processes to kill in this case).

"lsof" = list open files (other things like ports and devices count as files on Unix systems)

"-i" = search for internet address

":19421" = local machine, port 19421

I think they're missing a "-t" on lsof, to make it output process IDs only ("terse mode") instead of a human-readable table:

  kill -9 $(lsof -t -i :19421)

minusf|6 years ago

that works on all korn shell based posix shells.