http://www.perlmonks.org?node_id=1014366


in reply to Re^2: Finding and sorting files in massive file directory
in thread Finding and sorting files in massive file directory

If you put something like this in a while (there are files that start w/ a) loop, you should get around the issue of too many arguments. (Be sure to set increment=1 before the loop).
mkdir dir_a.$increment mv `ls a* | head -n1000` dir_a.$increment/ let increment++

Replies are listed 'Best First'.
Re^4: Finding and sorting files in massive file directory
by choroba (Cardinal) on Jan 21, 2013 at 02:04 UTC
    The problem is you will get "too many arguments" from ls a* already.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ