Skip to content

Instantly share code, notes, and snippets.

@nethoncho
Last active February 22, 2023 14:29
Show Gist options
  • Save nethoncho/161330e9538bbcfae783666c7eeaf230 to your computer and use it in GitHub Desktop.
Save nethoncho/161330e9538bbcfae783666c7eeaf230 to your computer and use it in GitHub Desktop.
Raspberry Pi Raspbian list open ports
netstat -lnt | grep LISTEN | awk '{ print ( $4 ) }' | awk 'BEGIN{FS=":"} { print $(NF) }' | sort -n | uniq
@hoang-himself
Copy link

-l already filters listening ports, so we can omit grep LISTEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment