Quantcast
Channel: User ozzy - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 31

Answer by ozzy for How to extract duplicate numbers from a log file?

$
0
0

You could use:

grep -oP 'SubscriberNumber=\K(\d+)' logfile | sort -n | uniq -cd
  • grep -oP 'SubscriberNumber=\K(\d+)' logfile isolates all individual SubscriberNumbers from your logfile;
  • sort -n sorts them numerically, and
  • uniq -cd prints any duplicate numbers, i.e. those with multiple occurrences, including a count.

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>