Tuesday, 16 April 2013

Unix:To View or Delete BLANK LINES from a File


1. To display or view blank lines:

$ grep ^$ filename

2.To remove or delete blank lines:

$ sed -i '/^$/d' filename

No comments:

Post a Comment