Re: how de delete a ligne from a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



NoSpaze wrote:
> 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

Or by number:

sed -i '2d' file

In the above example, 2 is the line number to remove.

> regex is a regular expression. For example, deleting the lines that end
> with "goodbye...":
> 
> sed -i '/goodbye\.\.\.$/d' file
> 
> :)
> ----------------------------------------------
> Rodolfo Alcazar - rodolfo.alcazar@xxxxxxxxxxxx
> otbits.blogspot.com / counter.li.org: #367962
> ----------------------------------------------
> "Träume nicht dein Leben, lebe deinen Traum."
> - Unbekannter Autor
> 

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux