LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   why is tar file showing different files/size to directory (https://www.linuxquestions.org/questions/%2Absd-17/why-is-tar-file-showing-different-files-size-to-directory-4175606790/)

robertkwild 05-27-2017 06:26 PM

why is tar file showing different files/size to directory
 
hi all,

why am i getting different file counts and different size for the same directory and tar file, they are the same directory i have made into a tar so i really dont get it

tar -tf /vol/cha-archive/audio/Even\ When\ I\ Fall\ -\ January\ 2017\ Project.tar | wc -l
8536

root@archive:/ # find /vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even\ When\ I\ Fall\ -\ January\ 2017\ Project/ -type f | wc -l
8464

137G /vol/cha-archive/audio/Even When I Fall - January 2017 Project.tar

138G /vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even When I Fall - January 2017 Project/

many thanks,

rob

rknichols 05-27-2017 08:11 PM

The tar archive will include directory names. The output from "find ... -type f" will not include directory names.

In a tar archive, then entry for a directory is just a header with the directory name and its attributes. The actual directory content (file names, inode numbers, ...) is not stored there. The actual directories on the disk do include that information. Usually, though, the tar archive is somewhat larger because every name in that archive has a 512-byte header. But, a directory that at one time contained a large number of entries can be quite large on the disk. A directory never shrinks when files are deleted. That excess space would not be present in the tar archive.


All times are GMT -5. The time now is 08:07 AM.