perl -e "print sort <>" file.txt #### perl -e "print sort {chomp($x=$a); chomp($y=$b); $x cmp $y} <>" file.txt