1 |
Apparently, though unproven, at 00:49 on Thursday 18 November 2010, Adam |
2 |
Carter did opine thusly: |
3 |
|
4 |
> I wasnt familiar with + but it changes the default behavior of this; |
5 |
> find /path -name something -exec ls -lS {} \; |
6 |
> which will run ls -lS once for each file, and therefore Sort doesnt work as |
7 |
> its only sorting a single file |
8 |
> |
9 |
> find /patch -name something -exec -ls -lS + |
10 |
> which runs ls -lS once against all the files that find finds (added as |
11 |
> additional arguments), and therefore Sort works. |
12 |
|
13 |
Almost right. |
14 |
|
15 |
-exec + will not append all filenames found and run one command, |
16 |
|
17 |
it will append the maximum number of filenames that do not exceed the shell |
18 |
command line limit, and do that enough times to get through all the filenames. |
19 |
|
20 |
You will be surprised how easy it is to get a directory with enough files in |
21 |
it to exceed the shell command length limit (65535 chars?). I have several |
22 |
users who will gladly show you how it's done, and will show you where they |
23 |
have each done it in multiple places |
24 |
|
25 |
-- |
26 |
alan dot mckinnon at gmail dot com |