list directories where all foles are dumpicated (rmlint)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
list directories where all foles are dumpicated (rmlint)
Hi, I want to scan a filesystem and list any directories which have been duplicated, I want to ignore date/time and ownership. Bu duplicated I mean dave the same files in them.
rmlint looks promising but not sure how to get it to just show a list of duplicated directories. fdfine and fdupes also seem promising but can't quite figure it out.
This is because some users have uploaded directory structures to multiple places but may of done it at different times from different users.
This is because some users have uploaded directory structures to multiple places but may of done it at different times from different users.
First idea I have:
Just list all the directories, and then sort the list by the base directory (the rightmost one) and its parent. Then you do the rest of the checking manually/visually.
Here's a quick Python implementation.
Code:
import os
def sortKey(root):
ds = root.split('/')
if len(ds) > 1:
return '/'.join(ds[-2:])
return ds[-1]
for root in reversed(sorted((root[0] for root in os.walk('.')), key=sortKey)):
print(root)
Do you mean files with the same name, or the same content, or really identical, i.e. same inode number?
Just the same name and content. Can get a list of duplicated but creating a report of duplicated folders is more tricky. sure I can work it out but will take a while and wondering if someone else has done this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.