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 Wed, Jan 5, 2011 at 6:15 AM, S Mathias smathias1972@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@centos.org From: S Mathias smathias1972@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?
"duplicate filenames"
-> duplicate filenames
--- On Wed, 1/5/11, Dominik Zyla gavroche@gavroche.pl wrote:
From: Dominik Zyla gavroche@gavroche.pl Subject: Re: [CentOS] recursively find duplicate filenames To: centos@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@centos.org http://lists.centos.org/mailman/listinfo/centos
On 1/5/2011 10:48 AM, S Mathias wrote:
"duplicate filenames"
-> duplicate filenames
--- On Wed, 1/5/11, Dominik Zylagavroche@gavroche.pl wrote:
From: Dominik Zylagavroche@gavroche.pl Subject: Re: [CentOS] recursively find duplicate filenames To: centos@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?
That's still ambiguous. Does duplicate mean exactly two instances with case insensitive matching? I think that's what your script does. Of course in a single directory, you can't have exact duplicates...
Do you mean exact duplicates of a basename found anywhere down a tree, your case insensitive match limited to one instance within a single directory, or ???
On Wed, 2011-01-05 at 08:48 -0800, S Mathias wrote:
"duplicate filenames"
While I realized that English is not the default language in Hungary, common courtesy would seem to dictate that if you're going to repeatedly forward your homework questions to scores of mailing lists you should at least make an attempt at more civility and less curtness in your responses.
At least until someone gets around to moderating you off of this list.
plonk
S Mathias wrote:
"duplicate filenames"
-> duplicate filenames
Please don't top post.
Now, a) you can't have identical filenames in the same directory, so shall I assume that you're looking for all files under one heirarchical directory structure that have the same name? If so,
find $1 -name $2 -ls
would give you all files of the same name. If, instead, you only needed to know how many of each, you could find $1 -name $2 | wc -l
mark
--- On Wed, 1/5/11, Dominik Zyla gavroche@gavroche.pl wrote:
From: Dominik Zyla gavroche@gavroche.pl Subject: Re: [CentOS] recursively find duplicate filenames To: centos@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@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Wed, Jan 5, 2011 at 9:46 AM, m.roth@5-cent.us wrote:
S Mathias wrote:
"duplicate filenames"
-> duplicate filenames
Please don't top post.
Now, a) you can't have identical filenames in the same directory, so shall I assume that you're looking for all files under one heirarchical directory structure that have the same name? If so,
find $1 -name $2 -ls
would give you all files of the same name. If, instead, you only needed to know how many of each, you could find $1 -name $2 | wc -l
Mark, don't waste your time on this twit - he cross posts to multiple lists, usually asking questions that are quite clearly basic shell or other utility programming questions that look more like school-work than anything else, he never thanks anyone for their answers and he seems to think we are here solely to do his school/home work for him.
I've yet to see a single question from him on any of the lists to which he posts which had anything directly to do with the list topics - here it would be CentOS specific questions. They're all basic, general programming questions that a thorough reading of the applicable man page would answer just fine.
On Wed, Jan 05, 2011 at 08:48:40AM -0800, S Mathias wrote:
"duplicate filenames"
Please stop top-posting in the CentOS mailing lists and please trim your replies down to only that needed. Mailing list guidelines are at:
http://www.centos.org/modules/tinycontent/index.php?id=16
Thank you for being considerate to your fellow list members.
John
On Wed, Jan 5, 2011 at 6:15 AM, S Mathias smathias1972@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...