.tar file (often called a tarball) consists of many different files that are stored in a single file for easy storage or sharing. Instead of putting multiple files in a folder, you can group them into a .tar file.
.tar files are usually compressed after creation to become .tar.gz files. Most people call a .tar or .tar.gz file a "tar file".
To create your own .tar file, enter the following command:
tar -czf [file.tar name] [folder name of the files to create]
If using macOS or Linux, use the following command in Terminal:
tar -xzf [file.tar name] [directory name of the files after decompression]
Note: Before that, you need to move to the folder containing the .tar file with the command cd..
In the above command, you see the -xzf paragraph, which is the additional syntax to perform each different function, including:
-v: Enable verbose mode, used to show status, notification or error during the command run.
-z: Use gzip for .tar.gz files (remove if the file only has a .tar extension).
-f: specify input file.
Instead of Terminal, the default Archive Utility tool on macOS helps you open .tar and .tar.gz files just by double clicking on the file to open in Finder.
On Windows, you can use 7-zip software to open it because the operating system does not support the default.