Aug 292010
How to use sed to simulate grep -v?
Answer:
There are two methods to simulate grep -v (print out line(s) if not match) in sed.
# sed -n '/regexp/!p'
or
# sed '/regexp/d'
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to use sed to simulate grep -v?
Answer:
There are two methods to simulate grep -v (print out line(s) if not match) in sed.
# sed -n '/regexp/!p'
or
# sed '/regexp/d'