cp -rP <dir name> <new dir name> to copy the contents of a directory, including permissions etc from one dir to another. The odd thing is, either du is giving me some strange results or the copy process is eating up extra blocks for some reason.
For example, the directory copied has an MemberNames.txt file. When copied, I get the following for it in the new (copied) directory:
$ du -sk MemberNames.txt 220 MemberNames.txt $ ls -al MemberNames.txt -rwxr-xr-x 1 root wheel 221344 May 4 00:04 MemberNames.txt
Now if I go the original directory and do the same things, I get this:
$ du -sk MemberNames.txt 88 MemberNames.txt $ ls -al MemberNames.txt -rwxr-xr-x 1 root wheel 221344 May 4 00:04 MemberNames.txt
In other words, it looks like the original file, directly above, is showing 88 blocks used and a file length of 221344 bytes, whereas the copied file is eating up 220 blocks and yet still has a length of 221344 bytes.
Either du is reporting something funky, I don't know how to use it or interpret it properly, or the copy operation (cp) is "scattering" the data into many more blocks than I think I need. If I do a diff on the files, there is no difference between them.
Can someone tell me what is happening, and better yet, how I can get cp to stop eating up more blocks than it needs. I'm not adverse to using a different file copy or transfer tool either, I just want to know why the copied directory is eating up almost 50% more space. This is happening to a lot of files, and a
du -sk on the new directory (copied) is almost 50% larger than the original, and yet from a content standpoint, everything is identical.