![untar command linux untar command linux](https://cdn.educba.com/academy/wp-content/uploads/2020/11/Linux-Untar.jpg)
If you are not using GNU tar and need to extract the contents of a tar archive file compressed with gzip (for example, my_), use the following command: To extract the contents of a tar archive file compressed with gzip (for example, my_), use the following command: To extract the contents of a tar archive file created by tar (for example, my_files.tar), use the following command: If gzip isn't available on your system, you can use the compress utility to create a compressed archive (for example, my_) for example (replace file1 and file2 with the names of the files you want to combine):
![untar command linux untar command linux](https://1.bp.blogspot.com/-kFcoH7Cn-OA/XaykMLZmL4I/AAAAAAAAACM/Njfl-fakyaotmkrVWDg7nxRg1IxfEYMCwCLcBGAsYHQ/s1600/zip6.png)
If your system does not use GNU tar, but nonetheless has gzip, you can create a compressed tar archive file (for example my_ with the following command (replace file1 and file2 with the names of the files you want to combine):
![untar command linux untar command linux](https://appuals.com/wp-content/uploads/2017/07/untar-1.png)
tar.gz are equivalent both signify a tar archive file compressed with gzip. In the above examples, the -z option tells tar to use gzip to compress the archive as it is created.To use tar and gzip to combine all the files in a directory into a compressed archive file (for example, my_), use the following command (replace /path/to/my/directory with the absolute path to the directory containing the files you want to combine):.To use tar and gzip to combine multiple files into a compressed archive file (for example, my_), use the following command (replace file1 and file2 with the names of the files you want to combine):.If your system uses GNU tar, you can use tar in conjunction with the gzip file compression utility to combine multiple files into a compressed archive file. Many Linux distributions use GNU tar, a version of tar produced by the Free Software Foundation. The -v option tells tar to be verbose (report all files as they are added).If you don't use the -f option, tar will assume you want to create a tape archive instead of combining a number of files.You can use any name in place of my_files.tar, but you should keep the.