------------------------------------------------------------------------ unfmt (opposite of "fmt") ------------------------------------------------------------------------ "fmt" formats text into lines which are approximately 72 characters each, avoiding breaking words. I like using line oriented text but Apple and Windows have popularized the concept of a single line per paragraph. The following sed line is the opposite of fmt: it converts each paragraph into a line, whilst keeping blank lines. $ cat a.txt Hello Mitty Meet Kitty who is from Japan # 1 2 3 4 5 6 $ gsed -n '/^$/!H;/^$/{g;s/\n/ /g;s/^ //;s/$/\n/p;z;x;}' a.txt Hello Mitty Meet Kitty who is from Japan Explanation: 1 2 3 4 5 6