Guest User

Untitled

a guest
Dec 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. # Generated by iptables 04:13:50 2015
  2. *filter
  3. :INPUT ACCEPT [0:0]
  4. :FORWARD ACCEPT [0:0]
  5. :OUTPUT ACCEPT [0:0]
  6.  
  7.  
  8. -A INPUT -p tcp -m tcp --sport http --dport 1024: -m state --state ESTABLISHED -j ACCEPT
  9. -A INPUT -p tcp -m tcp --sport https --dport 1024: -m state --state ESTABLISHED -j ACCEPT
  10. -A INPUT -p tcp -m tcp --sport webcache --dport 1024: -m state --state ESTABLISHED -j ACCEPT
  11. COMIT
  12. # Completed on Mon Dec 04:13:50 2015
  13.  
  14. INPUT
  15. FORWARD
  16. OUTPUT
  17.  
  18. 13:50
  19. INPUT
  20. 0]
  21. FORWARD
  22. 0]
  23. OUTPUT
  24. 0]
  25. 13:50
  26.  
  27. grep -Po ':K[^ ]*' file
  28.  
  29. sed -ne's/^:([[:upper:]]*).* $/1/p' <in >out
  30.  
  31. sed -ne's/^ *:([[:upper:]]*).*/1/p'
  32.  
  33. grep -Po '^ *:K[^ ]*' file
  34.  
  35. INPUT
  36. FORWARD
  37. OUTPUT
  38.  
  39. sed -n ' # -n do not print lines to output by default
  40. /^:.* $/ { # address lines beginning with colon, ending with space
  41. s/^:// # remove colon at beginning of line
  42. s/ .*// # remove first space and everything following
  43. p # print the edited line
  44. }
  45. '
Add Comment
Please, Sign In to add comment