Coreutils sort
From wikinotes
unix tool to sort input.
Examples
cat <<-EOF | sort def abc EOF # split by '/', sort by 2nd column (bat, air) cat <<-EOF | sort -t'/' -k2 /foo/bat/baz.txt /foo/air/baz.txt EOF # split by '/', sort by 3rd digit of 2nd column (t, r) cat <<-EOF | sort -t'/' -k2.3 /foo/bat/baz.txt /foo/air/baz.txt EOF