1 00:00:06,630 --> 00:00:08,850 - Alright, we already talked about it a little bit 2 00:00:08,850 --> 00:00:10,710 but you can compress your backups. 3 00:00:10,710 --> 00:00:12,720 By default, backups are not compressed. 4 00:00:12,720 --> 00:00:15,480 And for compression the traditional Linux philosophy 5 00:00:15,480 --> 00:00:19,140 is applied, which is connect multiple specialized tools 6 00:00:19,140 --> 00:00:22,320 instead of building the required functionality 7 00:00:22,320 --> 00:00:24,000 in all of the tools. 8 00:00:24,000 --> 00:00:25,590 The only thing that is 9 00:00:25,590 --> 00:00:28,350 that is included in, in Tar 10 00:00:28,350 --> 00:00:32,940 is minus z, minus j or minus uppercase J. 11 00:00:32,940 --> 00:00:34,950 And while using these options, 12 00:00:34,950 --> 00:00:37,710 the appropriate compression tool is called. 13 00:00:37,710 --> 00:00:41,100 So there are three main compression utilities. 14 00:00:41,100 --> 00:00:43,770 We've already seen them in the previous video 15 00:00:43,770 --> 00:00:45,810 but you can use them independently as well. 16 00:00:45,810 --> 00:00:47,640 So gzip is one of them. 17 00:00:47,640 --> 00:00:49,950 It has been the default tool for a long time. 18 00:00:49,950 --> 00:00:51,810 It's fast and also compatible 19 00:00:51,810 --> 00:00:53,820 to other operating systems. 20 00:00:53,820 --> 00:00:56,340 You can easily use a gzip compress file 21 00:00:56,340 --> 00:00:57,693 on windows, for instance. 22 00:00:58,560 --> 00:01:00,510 bzip2 was later introduced 23 00:01:00,510 --> 00:01:02,850 and it compresses in a more efficient way. 24 00:01:02,850 --> 00:01:06,090 And xz is the most recent trend in backups. 25 00:01:06,090 --> 00:01:07,830 The compression rate is great 26 00:01:07,830 --> 00:01:10,410 but it is significantly slower. 27 00:01:10,410 --> 00:01:15,410 Significantly, it takes double the amount of time or more. 28 00:01:15,810 --> 00:01:17,810 Let's figure out how to work with these. 29 00:01:20,730 --> 00:01:23,163 So we have the different files, right? 30 00:01:24,420 --> 00:01:27,750 And if I use gunzip 31 00:01:27,750 --> 00:01:30,780 on a files.tar.gz, 32 00:01:30,780 --> 00:01:31,950 now what is it going to do? 33 00:01:31,950 --> 00:01:33,750 Well, we can see what it's going to do. 34 00:01:33,750 --> 00:01:35,310 It's going to, 35 00:01:35,310 --> 00:01:39,460 to extract the tarball from the compressed file 36 00:01:40,590 --> 00:01:44,070 and it overrides the tarball that already existed. 37 00:01:44,070 --> 00:01:46,050 So what is the result? 38 00:01:46,050 --> 00:01:47,670 We don't have the gz anymore. 39 00:01:47,670 --> 00:01:49,560 It's really extracted. 40 00:01:49,560 --> 00:01:52,350 Now let me remove this tarball. Yes. 41 00:01:52,350 --> 00:01:56,550 And let's do something like this on a bzip. 42 00:01:57,812 --> 00:01:58,645 what was the utility? bunzip. 43 00:01:59,852 --> 00:02:01,170 A lot of step completion 44 00:02:01,170 --> 00:02:03,720 if you're not sure about what you are doing 45 00:02:03,720 --> 00:02:05,310 just type the first couple of 46 00:02:05,310 --> 00:02:06,990 of letters of the command 47 00:02:06,990 --> 00:02:09,990 and then you step completion to quickly verify. 48 00:02:09,990 --> 00:02:11,730 And then it looks as if you're really smart 49 00:02:11,730 --> 00:02:14,340 and if you really know what you're doing. 50 00:02:14,340 --> 00:02:16,505 So bunzip2, 51 00:02:16,505 --> 00:02:19,290 of files.tar.bz is doing what? 52 00:02:19,290 --> 00:02:20,123 Well, 53 00:02:21,180 --> 00:02:22,530 it's bunzipping. 54 00:02:22,530 --> 00:02:23,363 There we go. 55 00:02:23,363 --> 00:02:25,290 We have the tarball back again. 56 00:02:25,290 --> 00:02:27,873 And once again, I'm going to remove it. 57 00:02:28,830 --> 00:02:31,953 So last, there is xz. 58 00:02:32,970 --> 00:02:35,130 xz minus minus help, 59 00:02:35,130 --> 00:02:37,473 how do we uncompress with xz? 60 00:02:39,370 --> 00:02:42,870 We use xz minus d for decompress. 61 00:02:42,870 --> 00:02:44,550 Okay, here we go. 62 00:02:44,550 --> 00:02:46,180 xz minus d 63 00:02:47,469 --> 00:02:49,500 on files.tar.xz. 64 00:02:49,500 --> 00:02:54,500 And as you can see, we have back our files. tar. 65 00:02:54,510 --> 00:02:57,288 As you notice, all of these compression utilities 66 00:02:57,288 --> 00:02:59,640 are really decompressing, 67 00:02:59,640 --> 00:03:02,310 so you lose the original compress file. 68 00:03:02,310 --> 00:03:05,700 And the only thing remaining is the decompress file 69 00:03:05,700 --> 00:03:06,840 as you can see here. 70 00:03:06,840 --> 00:03:08,440 And that's how you can use them.