Skip to content

Instantly share code, notes, and snippets.

@pyohei
Created May 14, 2017 13:33
Show Gist options
  • Save pyohei/3ba751ce47424fe3ee27ea579e58082a to your computer and use it in GitHub Desktop.
Save pyohei/3ba751ce47424fe3ee27ea579e58082a to your computer and use it in GitHub Desktop.
look file diff as
#!/bin/sh
# You should language as english
# LANG=C
# Export new files or directories
diff -rq a b | grep "Only in" | cut -d":" -f2 | tr -d " " > new.txt
# Export diff files
diff -rq a b | grep "Files" | grep "differ" | cut -d " " -f2 > diff.txt
# Create file path.
find /tmp/b -type f
# split file path.
cat /tmp/aa.txt | while read line; do f=`basename $line`; d=`dirname $line`; echo -e "$d\t$f" >> filepath.txt; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment