linux delete line from file code example
Example 1: delete lines text file linux
sed -i '' '/pattern to match/d' ./infile
Example 2: linux remove lines from file
> sed '2,4d' file
sed -i '' '/pattern to match/d' ./infile
> sed '2,4d' file