Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

delete strings after match to eol using sed command

# To explicitly delete everything that comes after ".com", just tweak your existing sed solution to replace ".com(anything)" with ".com":
sed 's/.com.*/.com/' file.txt
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #delete #strings #match #eol #sed #command
ADD COMMENT
Topic
Name
2+6 =