Recursive dir comparison


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #! /bin/bash
  2. #
  3. # cmpdir - [email protected], 2007, GPLv2
  4. #
  5. # cmpdir <dir1> <dir2>
  6. [ -z "$2" ] && { echo “Usage: $SELF <dir1> <dir2>”; exit 0; }
  7. SRC=”$1″
  8. DST=”$2″
  9. (cd “$SRC”;find -type f)|while read i;do cmp “$SRC/$i” “$DST/$i”; done

URL: http://troxa.com/comparacion-recursiva-de-directorios-en-linux.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.