LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-02-2010, 02:56 AM   #1
sarew
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
duplicate files


How can I find a list of files that are named duplicates i.e. have same name but in different case that exist in the same directory?
 
Old 07-02-2010, 03:18 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Hi and welcome to LinuxQuestions!

From the top-level directory (if you need to descend recursively into a directory tree) you might try:
Code:
find | uniq -id
 
Old 07-02-2010, 03:00 PM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by colucix View Post
Code:
find | uniq -id
That doesn't produce anything useful when I try it.

I think the first thing to note is that "same name but in different case" is actually something of an oxymoron. If the case is different, they do not have the same name. E.g. hello and HeLLO are two different names.

The closest I've been able to get is this

Code:
mike@continuity:/tmp$ touch hello
mike@continuity:/tmp$ touch HEllO
mike@continuity:/tmp$ touch Hello
mike@continuity:/tmp$ find . -iname \* 2>/dev/null | sort | uniq -id 
./hello
mike@continuity:/tmp$
The output of the find command tells me that there is more than one file with a name that is a variant of hello. But it doesn't tell me that the other files are call. I can find them with another find command though

Code:
mike@continuity:/tmp$ find . -iname hello 2>/dev/null
./HEllO
./Hello
./hello
 
Old 07-02-2010, 03:10 PM   #4
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by sarew View Post
How can I find a list of files that are named duplicates i.e. have same name but in different case that exist in the same directory?
as root run 'updatedb'

when the process is finished, and you are looking for file 'gobbledigook' run

Code:
locate gobbledigook
Done.

updatedb runs as a cron job and executes every day at 10 PM.
 
Old 07-02-2010, 03:40 PM   #5
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by fruttenboel View Post
as root run 'updatedb'
locate, of course! I should have thought of that. It's not installed by default by all distributions. On SUSE distros it's in the package findutils-locate.

Quote:
Originally Posted by fruttenboel View Post
Code:
locate gobbledigook
You need to use the -i option to get a case insensitive search.

Code:
locate -i gobbledigook


Quote:
Originally Posted by fruttenboel View Post
updatedb runs as a cron job and executes every day at 10 PM.
It might run at 10PM on your machine, that doesn't mean it runs at 10PM on all Linux machines. It probably will be run at least once a day, but when it runs will vary depending on the Linux distribution being used.
 
1 members found this post helpful.
Old 07-03-2010, 04:21 AM   #6
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by arizonagroovejet View Post
You need to use the -i option to get a case insensitive search.

Code:
locate -i gobbledigook
Hey thanks for that. I'm using locate so long now that I never came to reading the man pages...

Quote:
It might run at 10PM on your machine, that doesn't mean it runs at 10PM on all Linux machines. It probably will be run at least once a day, but when it runs will vary depending on the Linux distribution being used.
True. I was not completely clear there. On my slackware systems it is installed by default. I put it in crontab to run at 10 PM, that being a time the machine will be running in the majority of times.
 
Old 07-06-2010, 07:40 AM   #7
Baresi
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
Smile

<<mod edit: Advertising deleted>>

Last edited by pixellany; 07-06-2010 at 09:29 AM.
 
Old 07-06-2010, 09:30 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Baresi;

Do not post advertising links---especially ones advertsing Windows SW!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
does tar or bzip2 squash duplicate or near-duplicate files? garydale Linux - Software 6 11-19-2009 04:43 PM
deleting duplicate files cs-cam Linux - General 3 11-14-2006 11:27 PM
duplicate files in one folder! hornung Linux - Enterprise 1 01-13-2005 03:35 PM
Duplicate Files and linux carl0ski Linux - Software 1 12-22-2004 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration