Skip to content

Commit 4b65849

Browse files
committed
Displays network ports on a system. Using '-4' limits to tcpv4 ports.
1 parent f9e3de1 commit 4b65849

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

network-ports.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# This script displays the open network ports on a system
4+
# Use -4 as an argument to limit to tcpv4 ports.
5+
6+
netstat -nutl ${1} | grep ':'| awk '{print $4}' | awk -F ':' '{print $NF}'

0 commit comments

Comments
 (0)