Pario TechnoBlob

  • Home
  • About
  • Archives
Skip to content

Pario TechnoBlob

A chronological documentation test project, nothing serious, really!

  • Home
  • About
  • Archives

Sort IP address

Posted on 12. November 20078. February 2008 by Hans-Henry Jakobsen

Sorting IP addresses using sort is not easy because the dot confuses sort.
This line makes it possible to sort by the whole value of the address

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

You can also sort by the last octet

sort -r. -n +3.0 ipaddresses.txt

Share this:

  • Facebook
  • X
Posted in: Linux, Network, ScriptingTagged: ip, sort

Post navigation

Previous: Shortening Apache Configs using mod_macro
Next: Strip EXIF tags from JPG files
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Search

Apache apt-get awk backup basename bash CentOS convert csv Database dd Debian esxi5 Etch EXIF Fedora find Gentoo grep howto html imagemagick iptables iso jhead JPG mount MySQL Nikon nmap perl PHP Postfix RedHat rename rhel5 sed sftp SMTP sort ssh Ubuntu VMware Wordpress Zimbra

  • Backup
  • Linux
  • Misc
  • Network
  • Photo etc
  • Scripting
  • Security
  • Virtualization
  • Web
  • Windows

Categories

  • Backup
  • Linux
  • Misc
  • Network
  • Photo etc
  • Scripting
  • Security
  • Virtualization
  • Web
  • Windows

Tags

Apache apt-get awk backup basename bash CentOS convert csv Database dd Debian esxi5 Etch EXIF Fedora find Gentoo grep howto html imagemagick iptables iso jhead JPG mount MySQL Nikon nmap perl PHP Postfix RedHat rename rhel5 sed sftp SMTP sort ssh Ubuntu VMware Wordpress Zimbra
Resume X WordPress Theme by Wp Theme Space