[Primipassi] Sintassi di find
Francesco
francesco@firenze.linux.it
Ven 5 Feb 2010 13:28:34 CET
Salve a tutti
non riesco a capire la sintaasi del comando find
se do questo comando
$find /home/francesco/ -iname "*.jpg" | grep linguetta
ho il seguente output
/home/francesco/montagna/linguetta1.jpg
/home/francesco/montagna/linguetta.jpg
vorrei trasferire i due file trovati in una dir pippo-bello
$ find /home/francesco/ -iname "*linguetta1" -exec mv ; /home/francesco/pippo_bello/
find: manca l'argomento di `-exec'
-bash: /home/francesco/pippo_bello/: is a directory
nel man find la sezione che tratta dell'opzione -exec dice:
############################################################################################
-exec command ;
Execute command; true if 0 status is returned. All following arguments to find are taken to be arguments to the
command until an argument consisting of `;'is encountered. The string `{}' is replaced by
the current file name being processed
everywhere it occurs in the arguments to the command, not just in argu‐
ments where it is alone, as in some versions of find. Bot of these constructions might need
to be escaped (with a `\') or quoted to protect them from
expansion by the shell. See the EXAMPLES section for examples of the
use of the -exec option. The specified command is run once for
each matched file. The command is
executed in the starting directory. There are unavoidable security
problems surrounding use of the -exec
action; you should use the -execdir option instead.
e dice anche:
-exec command {} +
This variant of the -exec option runs the specified command on
the selected files, but the command line is built by
appending each selected file name at the end; the total number of invoca-
tions of the command will be much less than the number of
matched files. The command line is built in much the same way
that xargs builds its command lines. Only one
instance of '{}' is allowed within the command. The command is executed in the starting directory.
################################################################################################
rimanda anche a la sezione esempi, ma non ho capito bene come va usata la
sintassi e se devo usare il ; oppure { }
grazie in anticipo per qualsiasi risposta
--
Francesco
Let's Drop The Knees Not The Bombs (Allen O'Bannon & Mike Clelland)
keyID 90675501
Key fingerprint = F747 9D1E E3C4 5572 0042 09F0 A852 529E 9067 5501
http://wikicosi.wordpress.com/
-------------- parte successiva --------------
Un allegato non testuale è stato rimosso....
Nome: non disponibile
Tipo: application/pgp-signature
Dimensione: 198 bytes
Descrizione: Digital signature
URL: <http://lists.linux.it/pipermail/primipassi/attachments/20100205/0866e4ba/attachment.pgp>
Maggiori informazioni sulla lista
primipassi