How to sort a file by its columns
Jun 04
2009
2009
Comments Off
# sort by user id ruby -a -F: -ne 'puts $F.values_at(2, 0).join("\t")' '/etc/passwd' | sort -g # sort by user home directory ruby -a -F: -ne 'puts $F.values_at(5, 0).join("\t")' '/etc/passwd' | sort -g # sort by username ruby -a -F: -ne 'puts $F.values_at(0).join("\t")' '/etc/passwd' | sort -g