I want to define a bash alias named kill3000
to automate the following task:
$ lsof -i:3000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ruby 13402 zero 4u IPv4 2847851 0t0 TCP *:3000 (LISTEN) $ kill -9 13402
There are two commands used to kill a process: kill – Kill a process by ID. killall – Kill a process by name.
alias kill3000="fuser -k -n tcp 3000"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With