PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Finding and copying unique files in a directory.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Finding and copying unique files in a directory.

Réponse
 
LinkBack Outils de la discussion
Vieux 07/09/2007, 15h34   #1
George Orwell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Finding and copying unique files in a directory.

I have a directory which contains photographs as jpgs. They are a bit mixed up - some sub-directories may contain files also in other sub-directories.

I want to create an archive of these pictures, and, rather than just copy the lot, including duplicates, I'd like to copy only one instance of each.

What is the best way to do this? I've started to think along the lines of:

# find . -print | xargs cksum | sort -u +0 -1

to get a list of filenames - but is there a better way?


Regards,


Il mittente di questo messaggio|The sender address of this
non corrisponde ad un utente |message is not related to a real
reale ma all'indirizzo fittizio|person but to a fake address of an
di un sistema anonimizzatore |anonymous system
Per maggiori informazioni |For more info
https://www.mixmaster.it

  Réponse avec citation
Vieux 07/09/2007, 17h02   #2
Maxwell Lol
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Finding and copying unique files in a directory.

George Orwell <nobody@mixmaster.it> writes:

> I want to create an archive of these pictures, and, rather than just copy the lot, including duplicates, I'd like to copy only one instance of each.
>
> What is the best way to do this? I've started to think along the lines of:
>
> # find . -print | xargs cksum | sort -u +0 -1
>
> to get a list of filenames - but is there a better way?


you can pipe it into awk, and only print files with a unique value.
Md5sum (or sha1sum) is better than cksum

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h35.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09199 seconds with 10 queries