In this example, we use the wildcard option on a backup backup.tar. z - compressed gzip archive file How to use the wildcard option In this example, we list the contents from a gzip backup without extracting it. z - compressed gzip archive file How to list contents of a tar(.gz) backup In this example, we extract content from a gzip backup, specifically a file called file.txt from the directory /backup/directory in the gzip file. # tar -exclude file.txt -exclude file.sh -cvzf How to extract content from a tar (.gz) backup In this example, we create a gzip backup called, but exclude the files named file.txt and file.sh by using the -exclude option. z - Compressed gzip archive file How to exclude files when creating a tar backup In this example, we create a gzip archive backup called of the directory /home/user. f - Name the archive How to create a tar.gz backup In this example, we create a backup called backup.tar of the directory /home/user. Also, the tarball is easily movable from one server to the next. This command is one of the most widely-used commands for this purpose. It compresses files and directories into an archive file, known as a tarball. Tar stands for tape archive and allows you to create backups using: tar, gzip, and bzip. The tar utility has a ton of options and available usage. It’s a common practice to complete and sometimes makes a difference in your finished work. In my personal experience, it has saved me more times than I can count. One of the key rules for working as a system administrator is always to make a backup. How well do you know Linux? Take a quiz and get a badgeĮver try something, it didn’t work, and you didn’t make a backup first?.Linux system administration skills assessment.A guide to installing applications on Linux.Download RHEL 9 at no charge through the Red Hat Developer program.To compress a folder, you should use tar + gzip, which is tar -z. On Linux, gzip is unable to compress a folder, it used to compress a single file only. In Linux, you can use gzip command to compress a file. Sometimes it is required to compress a file to save space, transfer safely or for other reasons. gunzip -l file_name.gzĬompress a file to a GZIP archive with GZ extension To view information about the compressive GZ gzip file, you can use the gunzip command like below, it does not uncompress the archive but give you vital information about the archive. If you want to keep the archive as well, please use the -k parameter with the command as below. Extract GZ file keep both orginal file and new so, your compressed archive is no longer available but the extracted file. v stands for verbose, which shows a log of actions happening while the archive is decompressed.Īlso note, after decompressing using gubzip, the GZ extention is removed from the file. If you want to see what happens during the unzip operation, you can user the -v parameter with the command. If the operation is successful, nothing is shown and linux command prompt is given back to the user Extract GZ file and see verbose output gz files we use gunzip command is used in Linux. gz files are compressed with gzip compression algorithm. To extract the GZ archive to the current directory, use below command. Extract GZ file keep both orginal file and newĮxtract GZ archive file in Linux Terminal.Extract GZ archive file in Linux Terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |