Difference Between Tar -Tf vs Tar -Tzf

Difference Between Tar -Tf vs Tar -Tzf

I am trying to list the contents of a tar file. I see that by combining -t and -f I can do so. It seems to work even for compressed archives.

The combination of -z in addition with -tf also seems to give the same result. Does this mean that -z in this context has no effect or the effect is there but not observable.

I am a noob. So pardon mistakes if any in my question.

2

1 Answer

You are correct that -tf and -tzf are the same for your file.

Modern versions of tar can automatically guess the type of compression of a compressed file. So, if it's a gzip file, it does not matter whether you specify the -z part or not.

For the same reason, you don't have to specify the j part in -tjf if it's a bzip2 compressed file.

Your Answer

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

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.