sed with multiple criteria

sed -e 1d -e 50d -e ‘/junks/d’

would remove first and 50th line & any line(s) with the word “junks”.

update 20080821 :

sed -e ‘/^$/d’

would remove every empty line

Related posts:

  1. how to search search & delete line in vi editor the below command in vi editor will remove the whole...
  2. Detect DDoS Source & Destination IP Address with OURMON We have OURMON running on one of network segment for...
  3. ls & rm with regular expression e.g. rm -rf backup-20070[8-9]-* would delete : backup-200708-morning backup-200708-evening backup-200709-night...
  4. Exim – anti-spam per domain setting acl_check_rcpt: blah … blah … blah … deny message =...
  5. run sql/queries (postgres) within bash e.g. for things-to-buy in $(psql -d database-name -U username -c...
  6. ssh client hang after a few minutes of inactivity specify the parameter “ServerAliveInterval 60″ in /etc/ssh_config or /etc/ssh/ssh_config. for...
  7. How to dig SRV record after creating it in DNS dig <record type> <host.name> e.g dig SRV _someservice._port.hostname.domainame.com.my OR dig...
  8. For My Reference, Gentoo’s emerge I have 2 gentoo machines, but not use it often,...
  9. useful unix command: xargs In our mailserver, we backup every incoming email and keep...

Leave a Reply