Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2005 17:56:22 -0500 (EST)
From:      user <user@dhp.com>
To:        freebsd-questions@freebsd.org
Subject:   cp/mv/etc : argument list too long ... I am sick of this
Message-ID:  <Pine.LNX.4.21.0512051747390.8684-100000@shell.dhp.com>

next in thread | raw e-mail | index | archive | help

Ok, so I have some big directories with lots of files.  If I do mv or cp,
it always refuses, telling me:

cp: argument list too long

so, no problem ... I get creative with things like this:

for f in 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W
X Y Z ; do cp $f* /some/dir ; done

lame, but it works.

----

but now I have some dirs that the above does not even work on.  One of the
numbers or one of the letters has too many files.

So I am sick of being childish and hacking up lame for loops just to copy
files.  Two questions:

- what is the number of files that is too many ? (err... arguments)

- since I live in 2005, what can I do to my FreeBSD system to upgrade it
to handle the directories I have ?  How do I fix this so I can do normal,
simple command lines instead of butchered ridiculous hacks like above ?

thanks.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0512051747390.8684-100000>