![根据第一个字段重新排列文件](https://linux22.com/image/222212/%E6%A0%B9%E6%8D%AE%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E6%AE%B5%E9%87%8D%E6%96%B0%E6%8E%92%E5%88%97%E6%96%87%E4%BB%B6.png)
我有一个包含示例输入内容的文件,想要按照所需输出重新排列。不确定如何用 sed 和 awk 来实现这一点。
输入样本
bni bce_merge_bni
bni def_merge_bni
bni linus_merge_bni
bni cat_merge_bni
bni ten_merge_bni
bni kit_merge_bni
us-canada chix_merge_usgenuity
us-canada cavin_merge_usgenuity
us-canada miuns_merge_usgenuity
us-canada ate_merge_usgenuity
us-canada eat_merge_usgenuity
所需输出
bni abc_merge_bni bce_merge_bni def_merge_bni linus_merge_bni cat_merge_bni ten_merge_bni kit_merge_bni
us-canada chix_merge_usgenuity cavin_merge_usgenuity miuns_merge_usgenuity ate_merge_usgenuity eat_merge_usgenuity