Skip to content

Instantly share code, notes, and snippets.

@lalinsky
Created January 3, 2020 06:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lalinsky/22ddbe6e7445ec8dbb38ba760822c3cf to your computer and use it in GitHub Desktop.
Save lalinsky/22ddbe6e7445ec8dbb38ba760822c3cf to your computer and use it in GitHub Desktop.
Bulk delete UFW rules
ufw status numbered | grep '# XXX' | perl -p -e 's{\[\s*(\d+)\].*}{\1}' | sort -rn | xargs -L1 ufw --force delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment