4 ms·
Not sure why he didn't just give us kill -9 $(lsof -i :19421)
by clebio 7y ago
Not sure why he didn't just give us
kill -9 $(lsof -i :19421)
- sooheon 7y agoFor the non bash users among us?
- minusf 7y agothat works on all korn shell based posix shells.
- mkl 7y agoThere'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)
- laumars 7y agoIs lsof part of the default install of OSX? It isn't usually part of the base install on Linux (though obviously very easy to install)
- bzbarsky 7y agoThat "command substitution" bit will fail on tcsh, say, last I checked.
- guitarbill 7y agoalthough command substitution is in the POSIX sh spec and so not a bashism, $(...) doesn't work in e.g. fish