Skip to content

Instantly share code, notes, and snippets.

@telendt
Created May 5, 2017 10:01
Show Gist options
  • Save telendt/e20e0a72577898fff0b17b27688d6f95 to your computer and use it in GitHub Desktop.
Save telendt/e20e0a72577898fff0b17b27688d6f95 to your computer and use it in GitHub Desktop.
Copy metadata recursively
#!/usr/bin/env bash
src="$1"
dst="$2"
find "$src" |
while read file; do
touch -c -r "$file" "$dst/${file#$src}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment