On Thu, 14 Sep 2017 11:07:40 -0400, Ernie Luzar wrote:
> I have a file containing a list of host domain names known to contain
> I want to sort the host names from right to left so they are grouped
> together by like host name suffixes.
> Is this possible?
Yes, easily, and provided by the OS. The "sort" command can do it.
... | sort -t '.' +2 | ...
Use the -t parameter to define the field separator, and +N to
set the sorting field (+2 means to sort according to the 3rd
field, i. e., +N means "go to the right N fields").