NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
fdupes, File::Find::Duplicate (Score:1)
A homegrown version can be found here (http://www.perlmonks.org/?node_id=703798), it uses File::Find::Duplicate.
Lots of hash based solution (Score:2)
There are lots of hash based solutions that can do this, some of them are easy written in Perl...
http://en.wikipedia.org/wiki/Fdupes [wikipedia.org], also lists alternatives (including one of mine!).
-- "It's not magic, it's work..."
uniq (Score:1)
Re: (Score:2)
"ls... glob" FAIL. Please don't do that.
Re: (Score:2)
Re: (Score:1)
The other point, that filenames can contain special characters, I was aware of, but I tend to assume that 'my' files won't (unless I know that they do). If I were working on some arbitrary set of files I would have done the job in Perl (I was going to say
find -print0and{sort,uniq} -zwould work, but apparently (my)uniqdoesn't have a-zoption. Weird.). Thanks for the correction, though, since it's important to beRe: (Score:1)
That won’t do what you wanted because
echowill output the whole shebang on a single line. What you want instead isBut then that still won’t do what you wanted, because you aren’t chopping the base path off the file names, so no two lines will have the same content anyway. You need to something like this:
Of course, as mentioned, that doesn
I'd just... (Score:2)