tar -tf going slow
I recently created a tar file containing several large files(like 50-200 MB each). I understand that it could take a while to add or extract large files, but I am just trying to list the files in the archive.
I do a "tar -tf file.tar", and it takes like 3 minutes to list the 15 files in the archive. Don't tar files keep an index of the files added to them? So, is this normal behavior? why would filesize affect the time it takes to list files? |
Yes, it seems to be normal behavior. No, there is almost certainly no index created by tar for its archives. (Where would it live?)
I did a little experiment to confirm what you're describing: Code:
$ du -h foo bar baz boo My WAG is he is actually extracting files to a temporary area - or /dev/null - just to do the listing. I didn't measure disk I/O, but I suspect you'd find lots of activity while listing a large archive. |
I would have expected that there was some kind of table of contents or index at the beginning of a tar file. kind of like with filesystems. I mean, an empty tar archive takes up 10K. It seems so inefficient to extract every file in a tar when you only need to list filenames. especially with large files.
|
All times are GMT -5. The time now is 10:05 PM. |