The Road to Elysium

October 28, 2008

Remove comments and empty lines with grep

Filed under: Snippets — jorge @ 12:39
$ grep -v -e ^# -e ^$ file.txt

3 Comments »

  1. Great, ty :))

    Comment by xhuli — May 18, 2010 @ 10:43

  2. thanks a lot dude

    Comment by sek — January 18, 2011 @ 12:15

  3. Try

    grep ^[^#] {file of interest}

    Comment by justin — January 3, 2012 @ 22:58

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress