Gentoo Archives: gentoo-user

From: Florian Philipp <lists@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Any way around "Argument list too long"?
Date: Tue, 19 Jul 2011 14:00:20
Message-Id: 4E258D94.1090707@binarywings.net
In Reply to: Re: [gentoo-user] Any way around "Argument list too long"? by Neil Bothwick
1 Am 18.07.2011 10:48, schrieb Neil Bothwick:
2 > On Sun, 17 Jul 2011 18:40:44 -0700, Grant wrote:
3 >
4 >> Alright, find is tricky. Is this the right spot for -delete?
5 >>
6 >> /usr/bin/find /home/user -type f -name "*-`/bin/date -d 'yesterday'
7 >> +\%Y\%m\%d`*.jpg" - delete
8 >
9 > Yes, but if you don't want irreversible mistakes, move the files instead.
10 >
11 > find /home/user -type f -name blah -exec mv -t ~/.Trashcan "{}" +
12 >
13 >
14
15 In all these commands it would always be a good idea to deactivate
16 parameter parsing just in front of the place where the file names are
17 inserted.
18
19 find ... -print0 | xargs -0 mv -t ~/.Trashcan --
20 or
21 find ... -exec mv -t ~/.Trashcan -- "{}" +
22
23 The double dash will prevent mv from interpreting weird file names like
24 "-h" as parameters. Just about every standard GNU tool supports this.
25
26 Regards,
27 Florian Philipp

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Any way around "Argument list too long"? Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] Any way around "Argument list too long"? Grant <emailgrant@×××××.com>
Re: [gentoo-user] Any way around "Argument list too long"? Joost Roeleveld <joost@××××××××.org>