RosettaCodeData/Task/Find-duplicate-files/Jq/find-duplicate-files.jq
2024-07-13 15:19:22 -07:00

9 lines
293 B
Text

# The following jq program assumes the input consists of a JSON array of objects having
# keys named "hash" and "filename".
def dictionary(stream; f; g):
reduce stream as $x ({}; .[($x|f)] += [$x|g]);
dictionary(inputs[]; .hash; .filename)
| to_entries[].value
| select(length > 1)
| [.[]]