在第一个逗号之前按字段排序,但保持文件的第一行不变

Sort by field before the first comma but keep the first line of the file as is

!sort -k 1n hits.csv -o output.csv

以上根据第一个逗号前的字段对文件进行排序。但是我如何保留第一行呢? (我希望 hits.csv 的第一行也显示为 output.csv 的第一行。)

$ pg test1.txt
keep this line
55, some stuff 1, other stuff 1
6, some stuff 2, other stuff 2
111, some stuff 3, other stuff 3
2, some stuff 4, other stuff 4
4, some stuff 5, other stuff 5
6, sdsdsdsdsdsdsds
7, ttttttttt

$ head -n 1 test1.txt >sorted.txt && tail -n +2 test1.txt | sort -k 1n >> sorted.txt

$ pg sorted.txt
keep this line
2, some stuff 4, other stuff 4
4, some stuff 5, other stuff 5
6, sdsdsdsdsdsdsds
6, some stuff 2, other stuff 2
7, ttttttttt
55, some stuff 1, other stuff 1
111, some stuff 3, other stuff 3