I want to compare the total size of the two directories dir1and dir2in different file systems, so that if diff -r dir1 dir2returned 0, then the overall dimensions are equal. The command dureturns disk usage, and its option --apparent-sizedoes not solve the problem. Now i'm using something like
find dir1 ! -type d |xargs wc -c |tail -1
know the approximation of size dir1. Is there a better solution?
edit: for example, I ( diff -r dir1 dir2returns 0: they are equal):
du -s dir1
du -s dir2
du -sb dir1
du -sb dir2
find dir1 ! -type d |xargs wc -c
find dir2 ! -type d |xargs wc -c
rafak source
share