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

Commands can have a maximum number of arguments. Try globbing on a directory with millions of files.


Usually the pattern is "for f in [glob]", which doesn't have that issue. Running "ls" on a directory is little more than "for f in *; echo $f" so there's little advantage to using "ls".

Also: "find -exec {} \+" will take ARG_MAX into account, and may be much faster depending on what you're doing.


Sane people will just use find and/or xargs.


Weird thing to call sane when its the shell that is insane, or more likely an instrument of torture.




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

Search: