Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Learn to use your shell's globbing features instead of overusing find. In zsh, you can do 'print -l /*.(c|cc|h|hh)' for example (I'm sure bash has an equivalent).


does that work for say 2143789 files?


I actually hit a limit quite a few times already - I don't remember if it was the shell that complained or the command (mv, cp, ...) itself, but I know I couldn't execute the command. find with xargs or -exec worked, however.


It's what happens if one uses * or similar globbing. The shell will try to pass all the files as arguments to the command and if it is too many, it will fail. That is why using find is often needed.


For me, the glob gets a lot of use.


    ** glob




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

Search: