That doesn't quite match the OPs stated requirements in that it will preserve the entire 'line', (which could be the entire file if this was a binary file), containing the keyword rather than truncating immediately after the keyword.
Has the advantage that it does matter how big the file (assuming non-binary), or how far into the file the truncation point is.
Has the disadvantage that it will consume more disc space rather than reducing it--if that was the original intent.
In reply to Re^3: grep and delete
by BrowserUk
in thread grep and delete
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |