Lucid IT dreams
Begrudgingly cumbersome mundane chore but the only easy day was yesterday
Monday, October 31, 2016
How to delete lines (not) containing specific string
How to delete lines (not) containing specific string
Remove lines not containing 2016-10-30
sed -i.bak '/2016-10-30/
!d'
./log.txt
Remove lines containing 2016-10-30
sed -i.bak '/2016-10-30/
d'
./log.txt
option -i.bak will create backup file.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Cybermap
Internet Storm Center Infocon Status
Internet Storm Center Infocon Status
No comments:
Post a Comment