WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.500 --> 00:00:16.300
Hey, welcome back to

1
00:00:16.300 --> 00:00:16.900
 this video.

2
00:00:17.700 --> 00:00:21.000
So in this video we are going to learn about archives

3
00:00:20.700 --> 00:00:25.200
 and how you can compress files

4
00:00:23.200 --> 00:00:26.600
 and directories into

5
00:00:26.600 --> 00:00:27.000
 Linux.

6
00:00:27.900 --> 00:00:30.800
We are going to see different compression techniques.

7
00:00:30.800 --> 00:00:33.600
 Also, we will see how you can zip

8
00:00:33.600 --> 00:00:37.000
 and unzip or extract those

9
00:00:36.000 --> 00:00:37.500
 archives.

10
00:00:38.400 --> 00:00:41.200
So let's quickly begin with the first one so

11
00:00:42.300 --> 00:00:45.400
First let's quickly go into our directory where

12
00:00:45.400 --> 00:00:48.300
 we are going to compress a directory. So

13
00:00:48.300 --> 00:00:52.100
 let's go and UFO net which is the directory in

14
00:00:51.100 --> 00:00:54.900
 which you can see. I have already created a

15
00:00:54.900 --> 00:00:57.600
 directory named Rohit. So

16
00:00:57.600 --> 00:01:00.100
 let's see what's inside it and you can

17
00:01:00.100 --> 00:01:03.900
 see there is a file which is hack dot txt

18
00:01:03.900 --> 00:01:07.200
 which contains the content or

19
00:01:06.200 --> 00:01:09.700
 the text which is I love hacking.

20
00:01:09.700 --> 00:01:12.400
 Alright, so let's go one step

21
00:01:12.400 --> 00:01:15.300
 back using CD Dot and now we are

22
00:01:15.300 --> 00:01:18.800
 back again in the UFO net directory. All

23
00:01:18.800 --> 00:01:18.900
 right.

24
00:01:19.700 --> 00:01:22.100
so the first thing or the First Command that we are going to

25
00:01:22.100 --> 00:01:23.500
 see is tar

26
00:01:24.700 --> 00:01:27.600
So basically we are going to create a tar

27
00:01:27.600 --> 00:01:31.000
 named archive, which is archive.tar which

28
00:01:30.300 --> 00:01:33.700
 will contain the directory which is Rohit

29
00:01:33.700 --> 00:01:36.200
 and for that the command that

30
00:01:36.200 --> 00:01:39.000
 we are going to use is tar compress.

31
00:01:39.700 --> 00:01:39.900
f

32
00:01:41.600 --> 00:01:44.200
archive dot tar which is the name that we are giving to

33
00:01:44.200 --> 00:01:47.300
 our archive and the directory that you want

34
00:01:47.300 --> 00:01:50.300
 to use or which you intend to

35
00:01:50.300 --> 00:01:54.600
 be compressed. All right, so we have finally compressed Rohit

36
00:01:53.600 --> 00:01:56.600
 directory into archive dot tar

37
00:01:56.600 --> 00:01:59.600
 now you can also decompress it

38
00:01:59.600 --> 00:02:02.400
 or you can decrypt it using the command which

39
00:02:02.400 --> 00:02:06.400
 is star x v f and

40
00:02:05.400 --> 00:02:08.300
 the tar name or

41
00:02:08.300 --> 00:02:09.600
 the compressed file name.

42
00:02:10.300 --> 00:02:13.200
As you can see it has finally decompressed it

43
00:02:13.200 --> 00:02:16.400
 and you can see the content which is Rohit slash heart

44
00:02:16.400 --> 00:02:18.600
 dot txt inside it perfect.

45
00:02:20.200 --> 00:02:23.800
Now let us move forward and now we are

46
00:02:23.800 --> 00:02:27.300
 going to see how you can create a gzip

47
00:02:26.300 --> 00:02:29.100
 compressed tar file, which is

48
00:02:29.100 --> 00:02:32.200
 a gun zip-based tar file. So for

49
00:02:32.200 --> 00:02:35.000
 that the command that we are going to use is star.

50
00:02:35.700 --> 00:02:36.800
c z f

51
00:02:37.800 --> 00:02:40.400
you can add The Hyphen or the

52
00:02:40.400 --> 00:02:44.100
 dash. It is not compulsory without it. Also

53
00:02:43.100 --> 00:02:45.400
 the command will work.

54
00:02:46.200 --> 00:02:50.100
Alright, so tar c z f and archive

55
00:02:49.100 --> 00:02:53.000
 dot tar dot gz and

56
00:02:52.900 --> 00:02:55.700
 directory that we want to gunship or

57
00:02:55.700 --> 00:02:58.700
 compress is Rohit as you can see it is

58
00:02:58.700 --> 00:03:01.500
 finally created a gunship file,

59
00:03:01.500 --> 00:03:05.200
 which is archive dot our DOT gz

60
00:03:04.200 --> 00:03:05.700
 perfect.

61
00:03:06.600 --> 00:03:09.300
So this was the second method or the

62
00:03:09.300 --> 00:03:12.700
 second way through which we can compress the

63
00:03:12.700 --> 00:03:16.000
 files. Now, let's quickly extract the

64
00:03:15.700 --> 00:03:18.400
 gunship or gzip files for

65
00:03:18.400 --> 00:03:19.800
 that. The command is star.

66
00:03:20.500 --> 00:03:24.100
X z f and the archive

67
00:03:23.100 --> 00:03:27.000
 name which we have recently compressed and

68
00:03:26.300 --> 00:03:29.900
 now this will decompress it. Perfect. So

69
00:03:29.900 --> 00:03:32.600
 in case sometimes you download few files

70
00:03:32.600 --> 00:03:35.500
 from the Internet or there are some programs of

71
00:03:35.500 --> 00:03:38.500
 binaries from GitHub which may be gun

72
00:03:38.500 --> 00:03:41.500
 zipped. So this is the command through which

73
00:03:41.500 --> 00:03:45.100
 you can decompress it and finally use

74
00:03:44.100 --> 00:03:45.300
 it.

75
00:03:47.200 --> 00:03:51.500
Perfect. Let's move forward and now we

76
00:03:50.500 --> 00:03:53.500
 are going to choose the same directory which

77
00:03:53.500 --> 00:03:56.400
 is Rohit again. But this time we are going to create

78
00:03:56.400 --> 00:04:00.100
 a tar file with B zip

79
00:03:59.100 --> 00:04:02.200
 to compression. Now. This is again

80
00:04:02.200 --> 00:04:05.100
 a new technique of compression that we are going to

81
00:04:05.100 --> 00:04:08.400
 use you may come across many times these types of

82
00:04:08.400 --> 00:04:12.000
 compressed files on GitHub and other various

83
00:04:11.700 --> 00:04:14.200
 websites. So that is the main reason

84
00:04:14.200 --> 00:04:17.300
 I'm showing you how you can create these types of

85
00:04:17.300 --> 00:04:20.500
 compressed files and if in case you have downloaded

86
00:04:20.500 --> 00:04:22.400
 it how you can decompress it.

87
00:04:23.200 --> 00:04:26.400
Now to create a bzep2 compression you

88
00:04:26.400 --> 00:04:28.700
 simply have to type the command which is star

89
00:04:29.500 --> 00:04:33.300
C J F and archive dot

90
00:04:32.300 --> 00:04:35.600
 tar dot b z 2

91
00:04:35.600 --> 00:04:38.500
 and the directory name which is Rohit perfect.

92
00:04:38.500 --> 00:04:41.200
 So we have successfully created a new

93
00:04:41.200 --> 00:04:44.700
 archive with bzep2 compression. Now

94
00:04:44.700 --> 00:04:47.900
 in case you want to decompress it the command

95
00:04:47.900 --> 00:04:50.700
 would be tar x j f

96
00:04:50.700 --> 00:04:53.800
 and archive dot r dot bz2 perfect.

97
00:04:53.800 --> 00:04:56.700
 This will decompress it again into

98
00:04:56.700 --> 00:04:59.500
 the original directory, which is Rohit.

99
00:05:00.200 --> 00:05:04.000
So this is it for this video? I hope you guys understood three

100
00:05:03.600 --> 00:05:06.800
 methods to compress and decompress the

101
00:05:06.800 --> 00:05:07.900
 files. Thank you.
