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