find /data/test -name "*.gif" [hier kommt noch was] -exec mv {} /data/produktiv \;
Die '{ }' Klammern müssen auf jeden Fall 'Escaped' werden, also:fuwa schrieb:Habe folgendes probiert:
find /data/test -name "*.gif" -amin -5 -exec cp {} /data/produktiv \;
find /data/test -name "*.gif" -amin -5 -exec cp \{\} /data/produktiv \;
snaewe schrieb:Die '{ }' Klammern müssen auf jeden Fall 'Escaped' werden, also:fuwa schrieb:Habe folgendes probiert:
find /data/test -name "*.gif" -amin -5 -exec cp {} /data/produktiv \;Code:find /data/test -name "*.gif" -amin -5 -exec cp \{\} /data/produktiv \;
find /data/test -name "*.gif" -amin -5 -exec cp -v {} /data/produktiv \;
find /data/test/. -name "*.gif" -amin -5 -exec mv -v {} /data/produktiv \;
Aber Du hast recht. Es geht auch ohne. Warum nur?3.3.1 Single File
-----------------
Here is how to run a command on one file at a time.
-- Action: -exec command ;
Execute COMMAND; true if 0 status is returned. `find' takes all
arguments after `-exec' to be part of the command until an
argument consisting of `;' is reached. It replaces the string
`{}' by the current file name being processed everywhere it occurs
in the command. Both of these constructions need to be escaped
(with a `\') or quoted to protect them from expansion by the shell.
The command is executed in the directory in which `find' was run.
For example, to compare each C header file in the current
directory with the file `/tmp/master':
find . -name '*.h' -exec diff -u '{}' /tmp/master ';'