Difference between revisions of "Useful commands"

From WTFwiki
Jump to navigation Jump to search
(Created page with "Parsing internet addresses from a log file, sorting, counting; grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" maillog | sort | uniq -c")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Parsing internet addresses from a log file, sorting, counting;
+
Parsing ipv4 addresses from a log file, sorting, counting;
 +
<pre>
 +
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" maillog | sort | uniq -c | sort -n
  
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" maillog | sort | uniq -c
+
</pre>

Latest revision as of 16:44, 19 December 2018

Parsing ipv4 addresses from a log file, sorting, counting;

grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" maillog | sort | uniq -c | sort -n