Problem with 'mv': list too long

If you are dealing with a lot of files, you will sometimes bump into the system limits for command lines. Here is an example of it:

Attachment: savea_20090901200021.log
/acct/vertex/[14]: /usr/bin/mv: 0403-027 The parameter list is too long.

Oooops. Not good. But very very easy to solve, as a matter of fact:

How to modify the system parameter

Simply enter the command:

smitty chgsys

Then, in the list of system parameters, search for the ARG/ENV list size in 4K byte blocks:

               Change / Show Characteristics of Operating System

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[MORE...9]                                              [Entry Fields]
  Amount of usable physical memory in Kbytes          32833536
  State of system keylock at boot time                normal
  Enable full CORE dump                               false                  +
  Use pre-430 style CORE dump                         false                  +
  Pre-520 tuning compatibility mode                   disable                +
  Maximum login name length at boot time             [9]                     +#
  Stack Execution Disable (SED) Mode                  select                 +
  NFS4 ACL Compatibility Mode                         secure                 +
  ARG/ENV list size in 4K byte blocks                [12]                    +#        <===
  CPU Guard                                           enable                 +
  Processor capacity increment                        1.00
  Partition is capped                                 true
  Partition is dedicated                              true

The default value of ARG/ENV list size in 4K byte blocks is 6. Slowly raise it (up to 1024 if needed) until your mv problem is solved!

The value change is immediate and will be applied the next time the machine is rebooted... It does not get any easier than this!

Another solution is to use the xargs command to pass each file, or directory, to the mv command one at a time. This is suggested in the links below.

See Also: