/ Published in: Bash

Perl 1 liner + additional linux command to find duplicate files and remove it - only spare 1 file.
Expand |
Embed | Plain Text
#!/bin/sh 'chomp;$x=$y;($y,$z)=split(/\s+/,$_,2); print "$z"."\x00" if ($x eq $y)' | xargs -0 rm -v -- #OR #if wanna find out size of all files to calculate space storage #change the # xargs -0 stat -c %s | awk'{SUM+=$1}END{print SUM/1024/1024}'
You need to login to post a comment.