#!/bin/sh
# Sort /etc/hosts file IPv4 only skipping empty lines and commented out ones

sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n /etc/hosts | grep . | grep -v '^#'

