{"authors":["utzer"],"canonical_url":"https://newblog.utzer.de/2019/03/15/lsof-local-open-ports/","categories":["Linux"],"content":"A short one:\n\n### Command\n\n```\nlsof -i -P -n | grep LISTEN\n```\n\nThis will output all the ports the system is listing on. You might have to prepend \"sudo\".\n\nSo then the command will be:\n\n```\nsudo lsof -i -P -n | grep LISTEN\n```\n\nThe list is long without the \"grep\", it will filter the output and only show the lines which contain \"LISTEN\".\n\nEdit:  \nOliver from [Hubzilla](https://fediverse.party/en/hubzilla/) (part of the [Fediverse](https://fediverse.party/en/fediverse/)) pointed out that\n\n```\nnetstat -anpl\n```\n\nmight be helpful too. The command shows all the listing sockets of the Linux machine it is run on. (I added the \"l\" parameter to just show listing sockets.\n","content_format":"markdown","date":"2019-03-14T23:42:02Z","description":"A short one: ### Command ``` lsof -i -P -n | grep LISTEN ``` This will output all the ports the system is listing on. You might have to prepend \"sudo\". So then the command will be: ``` sudo lsof -i -P -n | grep LISTEN ``` The list is long without the \"grep\", it will filter the output and only show t","html_url":"https://newblog.utzer.de/2019/03/15/lsof-local-open-ports/","json_url":"https://newblog.utzer.de/2019/03/15/lsof-local-open-ports/index.json","lastmod":"2019-03-14T23:42:02Z","markdown_url":"https://newblog.utzer.de/2019/03/15/lsof-local-open-ports/index.md","media":[],"schema_version":1,"tags":["grep","lsof","netstat","ports"],"title":"lsof - local open ports","type":"blog_post"}