[OTW] Grep vs SED

Robert P. J. Day rpjday at mindspring.com
Tue May 9 18:10:57 UTC 2006


On Tue, 9 May 2006, David Cary Hart wrote:

> (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?

why not use "time" to find out?

rday




More information about the fedora-list mailing list