Vai al contenuto

Benvenuto nella community di Italiamac Forum

Guest Image

Benvenuto su Italiamac, la più grande comunità AMUG italiana riconosciuta da Apple. La consultazione è libera. Se vuoi anche partecipare attivamente alle discussioni pubblicando post e messaggi puoi iscriverti gratuitamente, avrai molti vantaggi:

  • Pubblicare post, messaggi e richieste di aiuto
  • Fare amicizia e usare i messaggi privati fra utenti
  • Pubblicare annunci di vendita di usato
  • Usare tutte le funzioni della community

ISCRIVITI GRATIS


Change Mode






Automator replicare file in più cartelle


Recommended Posts

Ciao, io avrei bisogno di copiare dei file (7 per l'esattezza) sempre uguali, 
in una serie di cartelle (più di 200),
c'è un modo per evitare di fare mela+V più di 200 volte?

qualcuno sa suggerirmi un comando shell che può risolvermi questo grattacapo?w
Grazie

Link di questo messaggio
Condividi su altri siti

Da terminale dovresti poterlo fare così:

echo /PERCORSO_DESTINAZIONI/* | xargs -n 1 cp /PERCORSO_SORGENTI/* 

sostituendo i due percorsi ovviamente.
se i file sono tutti dello stesso tipo è meglio se lo specifichi alla fine, ad esempio se sono dei PDF è meglio usare:

echo /PERCORSO_DESTINAZIONI/* | xargs -n 1 cp /PERCORSO_SORGENTI/*.pdf 

 

 

An  a tuesday keeps the doctor away.

proud member of < noi finti professionisti > club - tessera 044

Link di questo messaggio
Condividi su altri siti

credo abbia quasi funzionato:

MBP-di-Pietro:~ pietro$ echo /Users/pietro/Desktop/prova 2/* | xargs -n 1 cp /Users/pietro/Desktop/prova/*.jpg 
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
MBP-di-Pietro:~ pietro$ 

 

Link di questo messaggio
Condividi su altri siti

Per gli spazi nei nomi cartella dei comandi ci vuole il carattere di escape:

echo /Users/pietro/Desktop/prova\ 2/* | xargs -n 1 cp /Users/pietro/Desktop/prova/*.jpg

 

An  a tuesday keeps the doctor away.

proud member of < noi finti professionisti > club - tessera 044

Link di questo messaggio
Condividi su altri siti
MBP-di-Pietro:~ pietro$ echo /Users/pietro/Desktop/prova\ 2/* | xargs -n 1 cp /Users/pietro/Desktop/prova/*.jpg
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 2.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 3.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia 4.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900 copia.jpg and /Users/pietro/Desktop/prova/_PIT4900 copia.jpg are identical (not copied).
cp: /Users/pietro/Desktop/prova/_PIT4900.jpg and /Users/pietro/Desktop/prova/_PIT4900.jpg are identical (not copied).
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
MBP-di-Pietro:~ pietro$ 

Ancora qualcosa non funziona

Link di questo messaggio
Condividi su altri siti

xargs non fa l'escape.... fai prima a togliere lo spazio nel nome della cartella "prova 2"

An  a tuesday keeps the doctor away.

proud member of < noi finti professionisti > club - tessera 044

Link di questo messaggio
Condividi su altri siti

Rispondi e partecipa alla discusione

Puoi rispondere subito e iscriverti successivamente. If you have an account, sign in now to post with your account.

Ospite
Rispondi a questa discussione...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Crea Nuovo...

Info

Questo sito utilizza cookies, anche di terze parti e profilazione. Utilizzando il sito acconsenti al loro impiego e dichiari di aver letto e di accettare: Privacy Policy Termini di utilizzo