News for hackers. Stuff that matters.
Re:look(1): lines beginning with given string by cfcef on Saturday December 12, 2015 @10:48PM (#10725353)
In the same vein of 'improvements over things everyone assumes you have to do with the more famous tool', we could say grep '^string' : look :: sort -R : shuf
Re:look(1): lines beginning with given string by nhaehnle on Saturday December 12, 2015 @11:11PM (#10725395)
Thanks to @climagic on Twitter, I recently learned that sort -R and shuf are not in fact the same thing. (sort -R doesn't actually shuffle...)
Re:look(1): lines beginning with given string by cfcef on Sunday December 13, 2015 @04:41PM (#10728088)
My point there was that besides being a true shuffle, 'shuf' also has an algorithmic advantage when you only need a few lines (similar to how lookup has an advantage when you only need a few).
Re:look(1): lines beginning with given string by ryan-c on Sunday December 13, 2015 @12:40PM (#10727041)
look does a binary search and only works on sorted files, while grep '^string' works on any text file but would be slower.