how de delete a ligne from a file

NoSpaze nospaze at gmail.com
Wed Jun 10 15:00:52 UTC 2009


Am Mittwoch, den 10.06.2009, 16:35 +0200 schrieb Adel ESSAFI:
> Hi list
> Is there a method to delete a line from a file withoout editing it!
> I have found how to do this with awk, but it is heavy!!

sed -i '/regex/d' file

regex is a regular expression. For example, deleting the lines that end
with "goodbye...":

sed -i '/goodbye\.\.\.$/d' file

:)
----------------------------------------------
Rodolfo Alcazar - rodolfo.alcazar at padep.org.bo
otbits.blogspot.com / counter.li.org: #367962
----------------------------------------------
"Träume nicht dein Leben, lebe deinen Traum."
- Unbekannter Autor





More information about the fedora-list mailing list