Horje
sed remove line containing Code Example
sed remove line containing
sed '/pattern to match/d' ./infile
delete a line starting with sed
# Delete all lines starting with '#'
$ sed -i '/^#/d' filepath
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
sed delete line before match
Use d option at the end of sed command string for deleting line of matches.
tac | sed -i "" "s/matching_pattern/I+1 d" file.txt | tac #
sed remove line
$ sed 's|http://||' <<EOL
http://url1.com
http://url2.com
http://url3.com
EOL
Source: catonmat.net




Shell

Related
git prune Code Example git prune Code Example
git prune remote branches Code Example git prune remote branches Code Example
git branch lists remote branches that do not exist anymore Code Example git branch lists remote branches that do not exist anymore Code Example
How to see incognito history? Code Example How to see incognito history? Code Example
install gnu grep on mac Code Example install gnu grep on mac Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10