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命令d August 3, 2014 awk多行合并为一行 August 29, 2014 sed正则 February 25, 2015