macOS list port usage

1.use lisof command

lisof: list all open files, is a linux command

An open file may be regular file, a directory, a block special file, a charactor special file, an executing text reference, a library, a stream or a network file(Internet socket, NFS file or UNIX domain socket.) A special file or all the files in a file system may be selected by path.

//compitable with macOS Sierra 10.12.4
#lsof -i -n -P | grep

Eudic     1229 lewis   16u  IPv4 0x7348b30605dcd4a7      0t0  TCP *:32094 (LISTEN)
Eudic     1229 lewis   34u  IPv4 0x7348b30605dcd4a7      0t0  TCP *:32094 (LISTEN)
Shadowsoc 1521 lewis    4u  IPv4 0x7348b306022769bf      0t0  TCP *:8090 (LISTEN)
Shadowsoc 1521 lewis    8u  IPv4 0x7348b30606fba9bf      0t0  TCP 127.0.0.1:1080 (LISTEN)
java      3762 lewis   60u  IPv6 0x7348b3060ebc2957      0t0  TCP *:8009 (LISTEN)
java      3762 lewis   76u  IPv6 0x7348b30602273417      0t0  TCP 127.0.0.1:8005 (LISTEN)
studio    3802 lewis  181u  IPv4 0x7348b30610e202b7      0t0  TCP 127.0.0.1:6943 (LISTEN)
studio    3802 lewis  365u  IPv4 0x7348b306040374a7      0t0  TCP 127.0.0.1:63343 (LISTEN)
adb       3810 lewis    6u  IPv4 0x7348b30610fb10c7      0t0  TCP 127.0.0.1:5037 (LISTEN)
QQ        4018 lewis   33u  IPv4 0x7348b30612cd30c7      0t0  TCP 127.0.0.1:4300 (LISTEN)
QQ        4018 lewis   34u  IPv4 0x7348b3061159dbaf      0t0  TCP 127.0.0.1:4301 (LISTEN)
java      4143 lewis   58u  IPv6 0x7348b3060c0bb417      0t0  TCP *:8080 (LISTEN)
java      4143 lewis   74u  IPv6 0x7348b30602273e97      0t0  TCP 10.203.6.187:8005 (LISTEN)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 14,601评论 5 6
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 7,957评论 0 0
  • 昨天是6月7日,高考的日子,我在QQ群说了一句话“离我儿子参加高考还有365天”,把大家都逗乐了。 今早看了一篇文...
    三倒拐阅读 1,306评论 0 0
  • 你喜欢风 他说风很烦吹乱了你的头发 你就离开了风口 开始刻意 躲着风 你讨厌念书 他说念书能增添一个人的气质 你就...
    懒墨阅读 1,432评论 0 3

友情链接更多精彩内容