项目作者: silicontrip

项目描述 :
yet another java duplicates finder
高级语言: Java
项目地址: git://github.com/silicontrip/yajdf.git
创建时间: 2018-11-15T03:18:51Z
项目社区:https://github.com/silicontrip/yajdf

开源协议:

下载


yajdf

yet another java duplicates finder

Description

Every man an his dog has written a duplicates finder and many existing tools (such as fdupes) do a fantastic job of finding duplicates.
But now that I have a list of duplicates how do I easily clean them up? Do I randomly delete one of the files?

This program attempts to create a rules parser to delete duplicate files.

Usage

Run with a java vm.

java -jar yajdf.jar ~/Music

After some time a prompt appears.
The number indicates the number of duplicate groups.
Display the list of duplicates with the print command.

Select duplicate groups with the group command followed by a colon and then the matching method, this command operates like grep and allows groups which match while ignoring those which don’t. The Matching method is made up of the following capitalised keywords Any or All or One followed by Name or Parent or Canonical
finally Contains or Equals or Matches or StartsWith then another colon and the matching string.

eg group:AnyNameContains:jpg is a valid matching command.

Any means any file in the group may match
All means all files must match
One means exactly one file must match

Name is the filename part of the path
Parent is the directory name of the path
Canonical is the full path.

Contains means the matching string is part of the pathname.
Equals means the matching string is exactly the same as the pathname.
StartsWith means the matching string is found at the start of the pathname.
Matches is a regex match of the pathname.

Selecting single files in a group is performed with the filter command, then followed by the same matching command as found in the group mathcing excluding All Create rules that select less than the number of total files in a group.

  1. java -jar yajdf.jar ~/Music
  2. -- SCAN --
  3. scanning... 0
  4. scanning... 618
  5. scanning... 490
  6. scanning... 246
  7. Files Remaining to Compare: 469
  8. -- COMPARE --
  9. comparing... 0/469 0
  10. comparing... 300/469 81
  11. 101> group:AnyNameContains:jpg
  12. 2> print
  13. /mnt/c/Users/mheath/Music/Compilations/One Perfect Day/AlbumArt_{B67670CF-FAA6-48FF-BFA4-CC8D6FDACAAE}_Small.jpg : /mnt/c/Users/mheath/Music/Compilations/One Perfect Day/AlbumArtSmall.jpg
  14. /mnt/c/Users/mheath/Music/808 State (Singles)/1991 - In Yer Face (Single)/Folder.jpg : /mnt/c/Users/mheath/Music/808 State/1991 - In Yer Face (Single)/Folder.jpg
  15. 2> filter:AnyNameContains:AlbumArt_
  16. 1> print
  17. /mnt/c/Users/mheath/Music/Compilations/One Perfect Day/AlbumArt_{B67670CF-FAA6-48FF-BFA4-CC8D6FDACAAE}_Small.jpg
  18. 1> delete
  19. Deleting... /mnt/c/Users/mheath/Music/Compilations/One Perfect Day/AlbumArt_{B67670CF-FAA6-48FF-BFA4-CC8D6FDACAAE}_Small.jpg

TODO

general command line parser improvements:
1) Readline command history. Allow arrow up to recall previous commands.
2) Readline command editing. Allow left and right arrows to move the cursor.
3) Readline tab completion. Pressing TAB to complete the unique part of the currently entered command.
4) ? help. Implement a help system similar to IOS when pressing ? will show the possible valid commands from what has been entered.
5) Implement unique abbreviations. Similar to IOS enter any number of characters to uniquely identify a valid command. This may also require adding spaces inbetween the matching rule keywords eg “group:AnyNameContains” becomes “group Any Name Contains” fully abbrevieated becomes “g an n c”