sed -i -e '/hoge/d' test.txt じゃダメなん?