Sort on the second whitespace-separated column.
Section: sort and uniq
Sort by a specific field
bash
bash
sort -k2,2 file.txtExplanation
Field sorting is essential for tabular command output.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing sort and uniq