sed合并行二 root@bwhhkle:~# cat lines.bak 1 2 3 4 5 6 root@bwhhkle:~# sed '{:z;N;$!bz;s/\n/ /g}' lines.bak 1 2 3 4 5 6 Tags: sed合并行, sed循环, sed详解 Read more articles Previous Postsed合并行 Next Postsed删除多余的空行 You Might Also Like sed空行规则 June 14, 2016 去重复空行 March 18, 2016 sed实现grep -Po 功能 April 17, 2017