Skip to content

Instantly share code, notes, and snippets.

@Airdawg5571
Last active October 18, 2023 07:01
Show Gist options
  • Save Airdawg5571/1a8c49ca5dd97af55ab9 to your computer and use it in GitHub Desktop.
Save Airdawg5571/1a8c49ca5dd97af55ab9 to your computer and use it in GitHub Desktop.
More organized (pretty-printed) iptables output.
#!/bin/bash
# Written and tested on CentOS 7
iptables -nvL |cut -f -9|column -t| sed 's/^Chain/\n&/g'|sed '/^Chain/ s/[ \t]\{1,\}/ /g'|sed '/^[0-9]/ s/[ \t]\{1,\}/ /10g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment