最佳答案
我试图在命令行中为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'