[SHELL] Cyklus na vyhledávání souboru
Nevite jak vyhledat v cca 30000 adresářích distribuce soubory s priponou *.gpg v cyklu?
find -type f -name "*.gpg" znam, ale ja potrebuji ten cyklus, protoze v kazdem novem pokusu, kdyz bude uspesny budu s tim gpg souborem delat jeste hromadu veci :)
Dekuji zkusenym za rady
Re: [SHELL] Cyklus na vyhledávání souboru
Parametr -exec prikazu find?
http://en.wikipedia.org/wiki/Find
Kód:
find /var/ftp/mp3 -name "*.mp3" -type f -exec chmod 644 {} \;
Citace:
The action is carried out by specifying the option -exec
chmod 644 {} \; in the command. For every file whose name ends in .mp3, the command chmod 644 {} is executed replacing {} with the name of the file. The semicolon (backslashed to avoid the shell interpreting it as a command separator) indicates the end of the command
Nebo tedy predat vysledek findu cyklu...
Kód:
for file in $(find -type f -name "*.gpg"); do jeste hromada veci s $file; done