What is the command to view ports and kill processes in macos system?

王林
Release: 2020-12-15 10:18:16
forward
3168 people have browsed it

What is the command to view ports and kill processes in macos system?

The specific commands are as follows:

lsof command can list all occupied ports:

lsof
Copy after login

Use less paging query

lsof | less
Copy after login

View

sudo lsof -i:port(端口号)
Copy after login

For example:

sudo lsof -i:8095
COMMAND PID USER   FD   TYPE  DEVICESIZE/OFF NODE NAME
java   7748 Dang   58u  IPv6 0x613f359336d889a3 0t0  TCP *:8095 (LISTEN)
Copy after login

Kill the process:

sudo kill -9 7748
Copy after login

Related recommendations: macos system

The above is the detailed content of What is the command to view ports and kill processes in macos system?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template