find duplicate filenames in a folder find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' find duplicate filenames in a folder recursively ? how?
On 01/05/2011 12:15 PM, S Mathias wrote:> find duplicate filenames in a folder > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' > > find duplicate filenames in a folder recursively > ? how?eg: /foo/bar.txt /foo2/bar.txt /foo3/bar.txt t
On Wed, Jan 5, 2011 at 6:15 AM, S Mathias <smathias1972 at yahoo.com> wrote:> find duplicate filenames in a folder > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' > > find duplicate filenames in a folder recursively > ? how?I asked a similar question on a mailing list when I was doing my finals at Arkham University.. Exact same sort of question actually .. Anyway, this was what someone sent me: find ~ -user `echo $LOGNAME` -exec touch {}_\*_${LOGNAME}\=`echo dupl644|tr pl64 mbas`_\* \; Let me know how it works. Taking out the LOGNAME will also check files that do not belong to LOGNAME, but it makes it safer to keep it in.
On Wed, 5 Jan 2011, S Mathias wrote:> To: centos at centos.org > From: S Mathias <smathias1972 at yahoo.com> > Subject: [CentOS] recursively find duplicate filenames > > find duplicate filenames in a folder > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' > > find duplicate filenames in a folder recursively > ? how?Try pinfo find Keith ----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
On Wed, Jan 05, 2011 at 03:15:03AM -0800, S Mathias wrote:> find duplicate filenames in a folder > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' > > find duplicate filenames in a folder recursively > ? how?What do you mean - duplicate? Duplicate by what? Name? Content? -- Dominik Zyla -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 195 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20110105/a883c0b3/attachment-0003.sig>
"duplicate filenames" -> duplicate filenames --- On Wed, 1/5/11, Dominik Zyla <gavroche at gavroche.pl> wrote:> From: Dominik Zyla <gavroche at gavroche.pl> > Subject: Re: [CentOS] recursively find duplicate filenames > To: centos at centos.org > Date: Wednesday, January 5, 2011, 1:11 PM > On Wed, Jan 05, 2011 at 03:15:03AM > -0800, S Mathias wrote: > > find duplicate filenames in a folder > > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 => $seen{$_}++' > > > > find duplicate filenames in a folder recursively > > ? how? > > What do you mean - duplicate? Duplicate by what? Name? > Content? > > -- > Dominik Zyla > > > -----Inline Attachment Follows----- > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >
On Wed, Jan 5, 2011 at 6:15 AM, S Mathias <smathias1972 at yahoo.com> wrote:> find duplicate filenames in a folder > find | perl -ne 's!([^/]+)$!lc $1!e; print if 1 == $seen{$_}++' > > find duplicate filenames in a folder recursively > ? how?Try this one: perl -e 'BEGIN{$|=1;$f=$ARGV[0];$s=(stat$f)[7];$t=time} while(sleep 1){printf"\r$f %s bytes at %.2f Kb/s ", $_=(stat$f)[7],($_-$s)/1024/(time-$t)}' Give it a few minutes to process if it's a large directory...