Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Text Wizardry: 10 Commands (gurge.com)
4 points by Vic-nyc on Dec 19, 2010 | hide | past | favorite | 1 comment


A good overview, but some bad examples. For 'find', he says:

<I>Combine with grep to find c++ files.

$ find | grep cpp</I>

That has at least two problems: 1. It will match 'cpp' anywhere in the name, such as 'tcpping.py', resulting in false positives. 2. It's inefficient, as there's no need to invoke grep at all. Much better just to use:

$ find . -name "*.cpp"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: