|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Dec 2005
Messaggi: 310
|
creare script
Ciao a tutti!
Vorrei creare un semplice script al fine di spostare tutti i files contenuti in una cartella in un'altra. Chi mi aiuta?
__________________
iBook G4 powered by Mac OS X 10.4.11 | Monitor widescreen LCD Philips 190SW8FS/00 | HiFi Kenwood UD-301 hp pavilion ze5425ea powered by Debian GNU/Linux Linux Registered User # 476519 |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
script? basta uno stupidissimo comando...
cp -R /path/to/dir1/* /path/to/dir2 Edit: mi ero scordato la wildcard
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it Ultima modifica di darkbasic : 14-11-2007 alle 20:14. |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Mar 2006
Messaggi: 2516
|
per copiare basta usare il comando cp
per "tagliare" o rinominare mv per entrambi metti prima la cartella dove stanno i file e poi quella dove li vuoi mettere. per copiarli tutti invece di indicare il file esatto metti il carattere * come nome del file cosi mv /cartella/da/copiare/* /destinazione/dei/file |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Dec 2005
Messaggi: 310
|
Grazie per le risposte!
Ho risolto in questo modo: cd /home/nome_utente/cartella A mv * /home/nome_utente/Desktop/cartella B Mi domando se, al fine di velocizzare tale operazione, posso accorpare tutto in un unico comando. Inizialmente ho pensato ad uno script da tenere sul Desktop e cliccare all'occorrenza. Infatti la cartella A è una cartella di downloads che periodicamente vado a svuotare.
__________________
iBook G4 powered by Mac OS X 10.4.11 | Monitor widescreen LCD Philips 190SW8FS/00 | HiFi Kenwood UD-301 hp pavilion ze5425ea powered by Debian GNU/Linux Linux Registered User # 476519 |
![]() |
![]() |
![]() |
#5 | |
Senior Member
Iscritto dal: Dec 2004
Messaggi: 3573
|
Quote:
Codice:
mv /home/nome_utente/cartella_A/* /home/nome_utente/Desktop/cartella_B #! /bin/bash seguito tutti i comandi che vuoi (dopo essere andato a capo ovviamente) chmod +x nomefile per renderlo eseguibile Dopodichè basta un ./nomefile o un click per eseguirlo.
__________________
Debian amd64 | Gentoo amd64 | AMD Athlon64 3800+ X2@2701Mhz vcore 1.49V | Placing an unpatched Windows computer directly onto the Internet in the hope that it downloads the patches faster than it gets exploited are odds that you wouldn't bet on in Vegas | e-mail+jabber: darkbasic|a.t|linuxsystems|d.o.t|it | www.linuxsystems.it |
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Dec 2005
Messaggi: 310
|
Grazie mille.
Funziona! ![]()
__________________
iBook G4 powered by Mac OS X 10.4.11 | Monitor widescreen LCD Philips 190SW8FS/00 | HiFi Kenwood UD-301 hp pavilion ze5425ea powered by Debian GNU/Linux Linux Registered User # 476519 |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 06:41.