[OTW] Grep vs SED
David Cary Hart
Fedora at TQMcube.com
Tue May 9 18:12:33 UTC 2006
(Off the Wall Question) I have been asked:
Given a very large file.txt and a desire to remove a matching line:
$ grep -v matching_line file.txt > file.txt.new
or;
$ sed '/matching_line _RegEx/d' file.txt > file.txt.new
Which method is more efficient or is it a tossup?
--
Our DNSRBL - Eliminate Spam: http://www.TQMcube.com
Multi-RBL Check: http://www.TQMcube.com/rblcheck.php
The Dirty Dozen Spammiest Ranges: http://tqmcube.com/dirty12.php
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060509/6835cb07/attachment-0001.sig>
More information about the fedora-list
mailing list