[Ilugc] Fwd: SORTING BY IP ADDRESS

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Mon Oct 29 10:48:45 2007

If you ever need to sort a file by IP
address, this little command  will
serve you well:

sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n

It will correctly sort IP addresses from
the first octet numerically, then each
following octet.

http://www.ugu.com/sui/ugu/show?tip.today

Bye :)
--
Bharathi S

Other related posts:

  • » [Ilugc] Fwd: SORTING BY IP ADDRESS - Bharathi Subramanian