$ perl -i.bak -0777pe'$_=join"\n",sort(split /\n/),""' users.dat $ cat users.dat.bak me you them she he it we $cat users.dat he it me she them we you