[lug] Another sed question.

Matt Thompson thompsma at jilau1.colorado.edu
Thu Mar 31 13:35:29 MST 2005


On Thu, 2005-03-31 at 12:58 -0700, Shannon Johnston wrote:
> I've got another one for all the experts.
> 
> I would like to locate a string of characters in a file, and delete the
> entire line that contains that string.
> 
> How would I go about doing that?

If you want to delete a line with a match you can do, say:

sed '/match/d' < input.txt

That will delete the newline as well.

-- 
The mayfly lives only one day, and sometimes it rains. - Geo. Carlin
   Matt Thompson -- http://ucsub.colorado.edu/~thompsma/
   440 UCB, Boulder, CO  80309-0440
   JILA A510, 303-492-4662
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3355 bytes
Desc: not available
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20050331/c14141b0/attachment.bin>


More information about the LUG mailing list