sed -e "$ ! s/a/b/"
This will match every line but the last. Confirmed with a quick test!
Related Contents:
- How can I replace each newline (\n) with a space using sed?
- What is the difference between sed and awk? [closed]
- Change multiple files
- Insert a line at specific line number with sed or awk
- sed fails with “unknown option to `s'” error [closed]
- How to insert strings containing slashes with sed? [duplicate]
- Add text at the end of each line
- How to remove trailing whitespaces with sed?
- How to escape single quote in sed?
- Have sed ignore non-matching lines
- Linux shell command to filter a text file by line length
- How to find and replace all occurrences of a string recursively in a directory tree? [duplicate]
- sed delete lines not containing specific string
- .bash_profile sed: \1 not defined in the RE
- Swap two columns – awk, sed, python, perl
- Remove non-ASCII characters from CSV
- Remove all lines before a match with sed
- How to use awk to print lines where a field matches a specific string?
- Combining two sed commands
- Replace all double quotes with single quotes
- How do I run the sed command with input and output as the same file?
- sed command in dry run
- sed, replace first line
- Using different delimiters in sed commands and range addresses
- How to globally replace strings in lines NOT starting with a certain pattern
- How to use sed to remove all double quotes within a file
- How to remove every other line with sed?
- delete a column with awk or sed
- Using different delimiters in sed commands and range addresses
- sed: 1: “…”: Invalid command code f
- sed: Replace part of a line
- Using sed to delete a case insensitive matched line
- Print lines in file from the match line until end of file
- Command to get nth line of STDOUT
- sed command with -i option (in-place editing) works fine on Ubuntu but not Mac [duplicate]
- How to pass a variable containing slashes to sed
- How to select lines between two marker patterns which may occur multiple times with awk/sed
- how to use sed, awk, or gawk to print only what is matched?
- How can I easily convert HTML special entities from a standard input stream in Linux?
- How to print lines between two patterns, inclusive or exclusive (in sed, AWK or Perl)?
- How to replace a path with another path in sed? [duplicate]
- How to use variables in a command in sed?
- Append line to /etc/hosts file with shell script
- Remove all text before colon
- find matching text and replace next line
- Insert lines in a file starting from a specific line
- How to increase max_connection in the official PostgreSQL Docker image
- Grep Regex: List all lines except
- How can I add a line to a file in a shell script?
- Extract version number from file in shell script