1

I have a file that I have tried transferring across the wired LAN via both scp and rsync, and both have yielded the same result. When I run du file on the file after the transfer, the file is 8 bytes larger on the recipient host.

I have also checked head file | hexdump -C on both hosts, and they are identical. Same story for tail...

Any ideas why this might be happening? If it matters, the file is a gzip.

  • 1
    Balanced usual (yet unnecessary) arse**** downvote. – gd1 Jul 20 '17 at 19:13
5

du file is not a suitable way to measure file size. Even the very first line of the man page says « du - estimate file space usage » (my italics).

Instead, use one or more of the following methods (others will also exist):

ls -l file       # byte size should be the same on both sides
cksum file       # checksum should be same result on both sides
md5sum file      # checksum should be same result on both sides
stat -c %s file  # byte size should be same result on both sides
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.