我正在尝试在命令行中终止ubuntu中特定端口的进程。
如果运行此命令,我将获得端口:
sudo lsof -t -i:9001
所以...现在我要运行:
sudo kill 'sudo lsof -t -i:9001'
我收到此错误消息:
ERROR: garbage process ID "lsof -t -i:9001".
Usage:
  kill pid ...              Send SIGTERM to every process listed.
  kill signal pid ...       Send a signal to every process listed.
  kill -s signal pid ...    Send a signal to every process listed.
  kill -l                   List all signal names.
  kill -L                   List all signal names in a nice table.
  kill -l signal            Convert between signal numbers and names.
我也尝试sudo kill 'lsof -t -i:9001'过