Answers for "sed remove line"

4

sed remove line containing

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

delete a line starting with sed

# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath
Posted by: Guest on July-07-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"  # remove 5th line
Posted by: Guest on June-15-2021
0

delete lines text file linux

sed -i '' '/pattern to match/d' ./infile
Posted by: Guest on October-20-2020
0

sed remove line

$ sed 's|http://||' <<EOL
http://url1.com
http://url2.com
http://url3.com
EOL
Posted by: Guest on June-21-2021
0

bash how to delete a specific line from a file

# Basic syntax:
sed 'line#d' input_file
# Where line# is the line you want to delete from the input_file

# Example usage:
input_file contains:
this is
my favorite
line

sed '2d' input_file
--> this is
--> line
Posted by: Guest on October-03-2020

Browse Popular Code Answers by Language