Thanks to everyone.

The resolve is to use:

cp -puRvf . /backup

Bernhard Lüder

This electronic mail is solely for the use of the addressee and may contain
information that is confidential or privileged.  If you receive this
electronic mail in error, please delete it from your system immediately and
notify the sender by electronic mail.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Herbert Xu
Sent: Sunday, February 25, 2001 2:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [SLUG] cp command - Argument list too long


Bernhard Lüder <[EMAIL PROTECTED]> wrote:

> cp -puRvf ./* /backup

> And I am getting this response:
> bash: /bin/cp: Argument list too long

If you aren't intentionally leaving out hidden files and the permission
of ., then do

cp -puRvf . /backup

Otherwise, (this requires GNU cp) try

find . -mindepth 1 -maxdepth 1 -name \* -printf %f\\0 |
        xargs -0 cp -puRvf --target-directory=/backup

BTW, the limit comes from the kernel, not cp or bash.
--
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to