Skip to content

Instantly share code, notes, and snippets.

@orbenor
orbenor / cpmd5.sh
Created July 3, 2022 08:30 — forked from subhacom/cpmd5.sh
rsync and md5sum: Use rsync to copy a directory and then generate a file containing the md5sum of all the files in source directory. Finally do a check of the md5sum of the target.
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 source dest [md5file]"
echo "Copy source directory into dest directory and put md5 sum of the files in source in md5file. "
echo "If no md5 file is unspecified it is created in current directory"
echo
exit 0
fi
source=$1
target=$2
@orbenor
orbenor / README.md
Created February 6, 2022 21:14 — forked from kdabir/README.md
Calculate space wasted because of duplicate files

Calculate the space wasted by duplicate files on your Hard Drive

Sometimes (rather always), duplicate files eat up space on hardrive. If you want to compute the total space wasted by such duplicate files this utility script may come handy. fdupes is a nice utility that finds the duplicate files in the given directories. This script consumes the fdupes output and calculates the space wasted.

These steps assume *nix flavor OS (OS X/Linux) but this might work on Windows+Cygwin as well

  1. Install fdupes on your machine (verify by doing fdupes --version on Terminal)