Answers for "remove lines sed"

4

sed remove line containing

sed '/pattern to match/d' ./infile
Posted by: Guest on December-23-2020
2

delete line in sed

# -i here update the file, try with and without -i, 
sed -i -e "/your_pattern/d" file 
sed -i -e "/your_pattern/,+2 d" file  # 2 lines after the pattern
sed -i -e '5,5d" file # remove 5th line
Posted by: Guest on June-15-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language