Updated: 04 March 2024
Sort by second column of tabulated data
$ printf "101\tc\n102\tb\n103\ta\n"
101 c
102 b
103 a
$ printf "101\tc\n102\tb\n103\ta\n" | sort -k2
103 a
102 b
101 c
Freelance software engineer United Kingdom
Updated: 04 March 2024
Sort by second column of tabulated data
$ printf "101\tc\n102\tb\n103\ta\n"
101 c
102 b
103 a
$ printf "101\tc\n102\tb\n103\ta\n" | sort -k2
103 a
102 b
101 c