[$] -> echo -e "foo\nbar\nbaz\n" > test.txt [$] -> perl -p -i -e 's/foo.*//s' test.txt [$] -> cat test.txt bar baz