Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #201348
| From | David Christensen <dpchrist@holgerdanske.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: any program that search for same files? |
| Date | 2018-10-17 06:20 +0200 |
| Message-ID | <wJLtn-4yU-3@gated-at.bofh.it> (permalink) |
| References | <wIWKe-7LZ-9@gated-at.bofh.it> <wIWKe-7LZ-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/14/18 3:06 PM, Long Wind wrote:
> given two directories, the program can print files that are in both
> directories
>
> to make it easy, if file name and size are same, then they are same
>
> i've to admit my memory is poor, if good, who need such program?
>
> i'm about to write it in java, it can be completed in a few hours but
> i think there might be simple solution
On 10/14/18 3:19 PM, The Wanderer wrote:
> Sounds like a perfect case for rdfind.
On 10/14/18 3:39 PM, Håkon Alstadheim wrote:
> fdupes or jdupes fit the bill.
On 10/14/18 6:11 PM, Erik Christiansen wrote:
> What I use with full satisfaction is just "diff -qr dir1 dir2"...
On 10/15/18 8:14 AM, Andrew McGlashan wrote:
> diff -s
On 10/16/18 12:53 AM, Long Wind wrote:
> it seems all those packages compare contents of files but my
> definition of same file is same name and size and should run much
> fast
>
> and they seem to search all directories for same files and this is
> different from my requirement
>
> my ideal program should take two directories as argument and print
> files that are in both directories
>
> i don't care same files within one directory
>
> my ideal program can also take one directory as argument and print
> same file in it if more than two directories are given, then first
> directory is searched, all files that are also in other directories
> are printed
>
> it seems i have to write it in java
>
> is there users' interest for such program?
It sounds like you want a script to meet your specific needs.
It is my belief that writing a general-purpose file system metadata
search utility is a non-trivial task. Take a look at find(1) to get an
idea of the scope of the most obvious related utility:
https://www.gnu.org/software/findutils/
Here is a Perl 5 script I wrote years ago to compare the modification
times of same-named files in two directory trees:
https://sourceforge.net/projects/dirdiff/
It could be modified to meet your requirements.
I suggest that you start at the small end -- writing scripts to meet
specific needs:
1. Pick a scripting language.
2. Define the requirements of the script.
3. Design, construct, test, debug, and document the script.
4. Integrate the script into your system administration processes.
Bonuses include:
1. Use a version control system.
2. Use an issue tracking system.
While you could use Java, understand that a Java runtime environment
must be installed for Java apps to work. sh, bash, perl, and/or python
are supported OOTB by many OS distributions, which makes it easier to
run your scripts inside fresh install, rescue, live, and other
restricted environments.
David
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-15 00:10 +0200
Re: any program that search for same files? The Wanderer <wanderer@fastmail.fm> - 2018-10-15 00:20 +0200
Re: any program that search for same files? Håkon Alstadheim <hakon@alstadheim.priv.no> - 2018-10-15 00:40 +0200
Re: any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-15 01:00 +0200
Re: any program that search for same files? The Wanderer <wanderer@fastmail.fm> - 2018-10-15 01:40 +0200
Re: any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-15 02:20 +0200
Re: any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-15 01:10 +0200
Re: any program that search for same files? Erik Christiansen <dvalin@internode.on.net> - 2018-10-15 03:20 +0200
Re: any program that search for same files? Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-10-15 17:20 +0200
Re: any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-16 10:00 +0200
Re: any program that search for same files? David Christensen <dpchrist@holgerdanske.com> - 2018-10-17 06:20 +0200
Re: any program that search for same files? Long Wind <longwind2@yahoo.com> - 2018-10-17 13:20 +0200
csiph-web