News for hackers. Stuff that matters.
Re:Explain Shell by mturmon on Monday December 02, 2013 @04:07PM (#6836530)
Just for definiteness, the equivalent "find" idiom would be:

  % find . -path '*foo*'
You need -path, not just -name, to match the whole name as du does.
Re:Explain Shell by jff on Monday December 02, 2013 @04:19PM (#6836597)
I'll point out that the find command is 21 characters, while mine is only 17. Efficiency!
Re:Explain Shell by mturmon on Monday December 02, 2013 @04:21PM (#6836610)
Yes, you have a point (plus, those stars, they burn the eyes).

But, your detractors will say yours is two processes and theirs is one. Efficiency!

Re:Explain Shell by jff on Monday December 02, 2013 @04:44PM (#6836753)
The kernel could start 100 processes in the time it takes me to type those extra four characters. We won't run out of processes. I did a test, finding .txt files in /usr/share, it took about .25 seconds longer with du and grep, which seems like less than it takes to type 4 more characters.
Re:Explain Shell by girvo on Monday December 02, 2013 @05:38PM (#6837100)
How long does it take you to type a character???
Re:Explain Shell by jff on Monday December 02, 2013 @05:44PM (#6837141)
Assume I type 80 wpm

A word is standardized as 5 keystrokes

80 wpm is therefore 400 keystrokes per minute.

Divide by 60 to get about 6.6 keystrokes per second, or about 0.15 seconds per keystroke.

Therefore it would take about 0.6 seconds to type the four extra characters, giving a net savings to use du+grep instead.

And 80 wpm is probably a rather fast estimate; I'd guess that I type slower when I'm writing commands than when I'm entering English text.

Re:Explain Shell by girvo on Wednesday December 04, 2013 @01:14AM (#6845328)
I must've read it wrong, or you fixed it, 'cause I read it as 25 seconds, hence my question! :)
Re:Explain Shell by w1ntermute on Monday December 02, 2013 @08:38PM (#6837949)
This is all moot, because you can just alias either command to a single letter if you use it that much.
Re:Explain Shell by mturmon on Monday December 02, 2013 @06:49PM (#6837490)
I will switch immediately! ;-)