sed line range, all but the last line July 24, 2023 by Tarik sed -e "$ ! s/a/b/" This will match every line but the last. Confirmed with a quick test!