Re: Deleting a line from a file

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

 



On Wed, 14 May 2014 16:34:20 +0200, Bernd Petrovitsch said:

> sed -i 's#^/opt/new1.*$#d' file_entries.txt

You don't even need the leading 's'.   Just   /pattern/d   is sufficient.

(And you can even do stuff like   /pat1/,/pat2/s/old/new/   which will
change 'old' to 'new', but only from a line that contains pat1 up to a
line that contains pat2, and *not* changing it before pat1 or after pat2....)

Attachment: pgp5KeAbsVuAR.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux