cp/mv/etc : argument list too long ... I am sick of this

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Dec 6 03:22:49 PST 2005


On 2005-12-05 18:44, user <user at dhp.com> wrote:
> On Mon, 5 Dec 2005, David Kelly wrote:
> > On Mon, Dec 05, 2005 at 05:56:22PM -0500, user wrote:
> > [...]
> > > - 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 ?
> >
> > Upgrade the user. Start with the man page to xargs(1) as you are far
> > from the first to have this problem.
> >
> > Is well and good that there be some limit to how much data one can pack
> > on the command line and incoming arglist in an application's
> > environment else fumble fingers could cause major havoc. IIRC its
> > currently 10k bytes.
>
>
> Yes, in addition to for loops, I also know how to use xargs.  I can use
> find.  I can do all sorts of trickery.
>
> What I want to know is, how can I just use cp ?

Move a level upwards.  If this fails:

    $ cd ~/foo
    $ mkdir ~/bar
    $ cp * ~/bar

this has better chances of working as expected:

    $ cd ~
    $ cp -Rp foo bar



More information about the freebsd-questions mailing list