sed でファイルの行頭に空行を入れる


簡単でした。
$ sed -i -e "1s/^/\n/" foo.txt

以下だとうまくいきません。n が残ってしまいます。
$ sed -i -e "1i \n" foo.txt