1 00:00:00,000 --> 00:00:04,300 [Intro Music] 2 00:00:04,319 --> 00:00:06,059 We have just discussed how to use 3 00:00:06,059 --> 00:00:07,979 such powerful search utility as 4 00:00:07,979 --> 00:00:09,929 'find', and I have demonstrated to you 5 00:00:09,929 --> 00:00:12,689 how you could easily and fast find 6 00:00:12,689 --> 00:00:14,309 the necessary files and folders. 7 00:00:14,669 --> 00:00:16,529 Now let me explain to you how to use 8 00:00:16,529 --> 00:00:18,419 the archive, and the compress 9 00:00:18,419 --> 00:00:21,899 utilities like tar and gzip. Let's 10 00:00:21,899 --> 00:00:24,209 first have a look at the help for 11 00:00:24,239 --> 00:00:27,119 such command as 'tar'. Type 'tar', and 12 00:00:27,149 --> 00:00:29,909 here will be '--help', and 13 00:00:29,909 --> 00:00:31,499 you'll find a bunch of different 14 00:00:31,529 --> 00:00:34,499 options that this command has. And 15 00:00:34,499 --> 00:00:35,789 if I scroll to the beginning of 16 00:00:35,789 --> 00:00:38,969 this output, I'll see that this 'tar' 17 00:00:38,999 --> 00:00:41,609 utility 'saves many files together 18 00:00:41,609 --> 00:00:44,039 into a single tape or disk archive, 19 00:00:44,249 --> 00:00:46,139 and can restore individual files 20 00:00:46,139 --> 00:00:48,359 from the archive'. It means that the 21 00:00:48,359 --> 00:00:51,389 main purpose of this 'tar' utility is to 22 00:00:51,389 --> 00:00:53,969 create archive. An archive is 23 00:00:53,999 --> 00:00:56,279 simply a set of files and folders 24 00:00:56,399 --> 00:00:59,009 located in a single file. And 25 00:00:59,009 --> 00:01:00,689 such archives have usually 26 00:01:00,689 --> 00:01:04,259 extension 'tar', '.tar'. And this 27 00:01:04,259 --> 00:01:06,029 utility has a lot of different 28 00:01:06,059 --> 00:01:09,719 options like, 'c' - create new archive, 29 00:01:09,989 --> 00:01:12,389 't' - list the contents of the archive, 30 00:01:12,389 --> 00:01:15,300 'update', 'extract', and so on. There 31 00:01:15,329 --> 00:01:17,159 are many many different options, 32 00:01:17,159 --> 00:01:18,629 but of course you don't need to 33 00:01:18,629 --> 00:01:21,299 memorize all of them. Most common 34 00:01:21,299 --> 00:01:23,309 operations with the 'tar' utility 35 00:01:23,549 --> 00:01:25,649 are creation of the archive and 36 00:01:25,649 --> 00:01:27,599 extractions of the files from the 37 00:01:27,599 --> 00:01:31,289 archive. Also, using such option as 't' 38 00:01:31,349 --> 00:01:32,999 you are able to list the contents 39 00:01:33,029 --> 00:01:35,609 of the archive. But please notice 40 00:01:35,609 --> 00:01:38,879 that by default with just 'c' option, 41 00:01:38,879 --> 00:01:41,009 for example, you will not create 42 00:01:41,039 --> 00:01:43,379 compressed archive, you will simply 43 00:01:43,379 --> 00:01:45,779 create a tar file that will contain 44 00:01:45,929 --> 00:01:48,509 other files and folders. And if you 45 00:01:48,509 --> 00:01:50,339 want to additionally compress this 46 00:01:50,339 --> 00:01:52,469 archive, you could either use 47 00:01:52,499 --> 00:01:54,689 additional option with tar file 48 00:01:54,779 --> 00:01:57,389 that is '-z' option, or you could 49 00:01:57,389 --> 00:02:00,689 use another utility gzip. Let me 50 00:02:00,719 --> 00:02:02,599 show you help for this utility 51 00:02:02,599 --> 00:02:05,849 'gzip --help'. And if you'll 52 00:02:05,849 --> 00:02:07,679 scroll up, you'll find information 53 00:02:07,679 --> 00:02:09,779 about this utility. It compresses 54 00:02:09,809 --> 00:02:13,919 or uncompresses file or files. And 55 00:02:13,949 --> 00:02:16,229 you could create the archive using 56 00:02:16,319 --> 00:02:18,599 'tar' command, and afterwards compress 57 00:02:18,629 --> 00:02:20,309 that archive using 'gzip' 58 00:02:20,309 --> 00:02:22,739 utility; or you could use simply 59 00:02:22,769 --> 00:02:24,629 '-z' option inside of the 60 00:02:24,629 --> 00:02:26,699 'tar' utility, that will create the 61 00:02:26,729 --> 00:02:28,469 compressed archive automatically. 62 00:02:29,249 --> 00:02:30,749 And please note that such 63 00:02:30,749 --> 00:02:32,909 compressed archives will have 64 00:02:33,119 --> 00:02:37,570 following format, 'archive.tar.gz'. 65 00:02:37,570 --> 00:02:39,299 And that means that 66 00:02:39,329 --> 00:02:41,309 first archive is created with 67 00:02:41,309 --> 00:02:43,499 extension '.tar'; and afterwards 68 00:02:43,529 --> 00:02:45,749 this archive is compressed using 69 00:02:45,779 --> 00:02:48,179 'gzip' utility; and additional 70 00:02:48,269 --> 00:02:51,629 extension '.gz' is added. And 71 00:02:51,629 --> 00:02:53,699 that is the most common format of 72 00:02:53,699 --> 00:02:56,429 archives in Linux. And usually when 73 00:02:56,429 --> 00:02:58,649 you download some files, Linux 74 00:02:58,649 --> 00:03:00,989 files from internet, you download 75 00:03:00,989 --> 00:03:03,209 them in compressed archived format. 76 00:03:03,629 --> 00:03:05,489 And you'll see exactly such 77 00:03:05,489 --> 00:03:09,449 extension as '.tar.gz'. And of course 78 00:03:09,449 --> 00:03:11,579 using 'tar' utility you could easily 79 00:03:11,759 --> 00:03:14,429 uncompress and extract files from 80 00:03:14,459 --> 00:03:17,039 such archives. Alright, that is a 81 00:03:17,039 --> 00:03:19,664 short description of those two utilities. 82 00:03:19,664 --> 00:03:21,059 There are of course other 83 00:03:21,089 --> 00:03:23,159 compressed utilities like 'zip' that 84 00:03:23,159 --> 00:03:24,959 is very popular in Windows systems. 85 00:03:25,079 --> 00:03:27,899 But 'gzip' is most popular choice 86 00:03:27,929 --> 00:03:30,149 for Linux like systems. That's why 87 00:03:30,179 --> 00:03:31,739 most common extension that you will 88 00:03:31,739 --> 00:03:35,489 see is '.tar.gz'. Alright, next let's 89 00:03:35,519 --> 00:03:37,289 dive a bit into practice, and let's 90 00:03:37,289 --> 00:03:38,999 create some archives, and compress 91 00:03:38,999 --> 00:03:40,199 them. I'll see you in the next 92 00:03:40,199 --> 00:03:41,228 lecture. Bye. 93 00:03:41,228 --> 00:03:43,765 [no audio]