Created
May 14, 2017 13:33
-
-
Save pyohei/3ba751ce47424fe3ee27ea579e58082a to your computer and use it in GitHub Desktop.
look file diff as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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