How to create and manipulate tar archives using Python - LinuxConfig.org

On Linux and other Unix-like operating systems, tar is undoubtedly one of the most used archiving utilities; it let us create archives, often called “tarballs”, we can use for source code distribution or backup purposes. In this tutorial we will see how to read, create and modify tar archives with python, using the tarfile module.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-create-and-manipulate-tar-archives-using-python

My problems with tarballs is not extracting them, I have emgrampa for that. It is knowing in what directory to put the files. CD where?