MCVE: printf '%s %s\n' a b >afile vsed -i -e '/a b/d' afile Expect: - afile should be empty Actual: - afile is not empty