Pages

Thursday, March 20, 2014

find which lines in a file are longer than N characters

$ sed -n "/^.\{73,\}/p" < /path/to/file

Filter out lines of input that contain 72, or fewer, characters.


"sed -n" : don't print lines by default


"/^.\{73,\}/" : find lines that start with 73 (or more) characters


"p" : print them




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/NwUQZL

No comments:

Post a Comment