Last active
March 6, 2018 21:06
-
-
Save sergeyhush/b253cd38f0b080ddcf3b013d27dedb0a to your computer and use it in GitHub Desktop.
Sort /etc/hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 '^#' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment