Find
De Linuxmemo.
(Différences entre les versions)
(→options remarquables) |
(→options remarquables) |
||
Ligne 18 : | Ligne 18 : | ||
;-execdir cp {} /home/ \; | ;-execdir cp {} /home/ \; | ||
- | find | + | find . -iname "*.mkv" -execdir cp -v {} /mnt/popcorn/Video/MKV/ \; |
Using both basename and full path in find -exec for cp | Using both basename and full path in find -exec for cp | ||
Version du 1 mars 2014 à 21:17
find . -type d -iname thumbs
options remarquables
- -maxdepth 1
limite a partée 1 au répertoire courant (non récursif)
- -iname "*.gz"
recherche nominative insensible a la caste
- -mtime +30
plus vieux de 30 jour (24h*30)
- -exec rm -f {} \;
suppression du résultat
- -execdir cp {} /home/ \;
find . -iname "*.mkv" -execdir cp -v {} /mnt/popcorn/Video/MKV/ \;
Using both basename and full path in find -exec for cp
Astuces
find . -iname "*.mkv" | xargs stat -c %s | awk '{a+=$1;print a}' |tail -1 Calcul de conversion: kilobytes=$((bytes / 2**10)) megabytes=$((bytes / 2**20)) gigabytes=$((bytes / 2**30))