Contents
For this, open a command-line terminal and then type the following commands to open and extract a .tar.gz file.
- Extracting .tar.gz files.
- x: This option tells tar to extract the files.
- v: The “v” stands for “verbose.”
- z: The z option is very important and tells the tar command to uncompress the file (gzip).
How do I untar a tar gz file in Linux?
For this, open a command-line terminal and then type the following commands to open and extract a .tar.gz file.
- Extracting .tar.gz files.
- x: This option tells tar to extract the files.
- v: The “v” stands for “verbose.”
- z: The z option is very important and tells the tar command to uncompress the file (gzip).
How do I create a tar file in Linux?
How to tar a file in Linux using command line
- Open the terminal app in Linux.
- Compress an entire directory by running tar -zcvf file.tar.gz /path/to/dir/ command in Linux.
- Compress a single file by running tar -zcvf file.tar.gz /path/to/filename command in Linux.
- Compress multiple directories file by running tar -zcvf file.tar.gz dir1 dir2 dir3 command in Linux.
How do I open a tar file in Terminal?
Steps
- Open the terminal.
- Type tar .
- Type a space.
- Type -x .
- If the tar file is also compressed with gzip (.tar.gz or .tgz extension), type z .
- Type f .
- Type a space.
- Type the name of the file that you wish to extract.
How do I create a Tar GZ file in Linux?
Create and extract a .tar.gz archive using command line
- To create a tar.gz archive from a given folder you can use the following command. tar -zcvf tar-archive-name.tar.gz source-folder-name.
- To extract a tar.gz compressed archive you can use the following command. tar -zxvf tar-archive-name.tar.gz.
- To Preserve permissions.
- Switch the ‘c’ flag to an ‘x’ to extract (uncompress).
Photo in the article by “Wikipedia” https://de.wikipedia.org/wiki/Malaria