In this Linux commands article, you will learn how to use zip/unzip command-line utilities to create and extract zip file files on Linux/Unix-like operating systems.
‣ For Direct Links & Commands
‣ https://linuxh2o.com/linux-commands-create-and-extract-zip-files/
☼ Also, check out other videos ☼
➟ Transfer files with Warpinator in Linux Mint 20 Ulyana
➟ https://youtu.be/BpOMv1mXz8E
➟ Must have Linux apps guide for power users
➟ https://youtu.be/udj2PWCD66k
➟ Best ebook readers for Linux (epub, mobi, azw3, pdf)
➟ https://youtu.be/KiFOymLAnXA
➟ ProtonVPN • Best Free VPN Service For Linux
➟ https://youtu.be/rTcTvpSIvBg
➟ Enable Single Click Feature in File Manager
Show More Show Less View Video Transcript
0:00
Hello there and welcome to Linux S2O and this video is about how to use command line tool
0:09
zip and unzip to create zip archive files and to extract those zip archive files. So why we need to
0:17
learn the command line utility tools? I mean in the graphical user interface it's pretty easy. So
0:22
if I have set up this folder here so if you want to create any archive file you can simply select
0:27
the file or folder so I'm going to select your files I can hit the compress type in the name
0:32
I can hit enter and this will create the archive file I can extract it by clicking write and extract
0:40
here or extract true and this will extract the file and I can see the content of the folder but
0:46
there are scenarios when we do not have access to the graphical user interface and there you only
0:52
have to use the command line to do just that and let me show you how to do that so I'm going to
0:59
delete these files from here and I'm going to open up the terminal emulator and I'm going to
1:03
navigate to this folder so I'm going to type cd and deli because I have created this folder here
1:10
so you can easily see like I have this file and this folder and this is not distinguishing between
1:16
the file and folder probably because of the theme so I'm going to use a regular terminal emulator
1:21
So I going to hit enter and this is my terminal program and here is the deli folder Add in CD to deli here and here are the files you can see these are the two files and this is the folder so let me just clear it up so that you can see more clearly so in order to
1:43
create the chip file we have to use the chip utility tool and before using that tool we have
1:49
to install it so you can use your installation command for a particular distribution so if you
1:54
you use debian ubuntu or any of their derivatives then you can use advanced
1:59
packagement tool for reddit family you can use dnf for arts you can use pacman
2:04
so you probably know what the tool you should have to use to install the
2:09
utilities and if you do not know then check out the link in the description it will show you just that so this is ubuntu and I'm going to use the apt
2:17
command at sudo apt install I'm going to install two utility tools one is chip
2:21
and another one is unzip now you can simply hit enter and this will ask me for the password
2:29
I can type in the password and this will install the usability tools so the tools has been installed
2:34
in the system now you can check where are the tools available you can simply hit the
2:39
chip and unzip command. So both the tools are installed in the system and now
2:51
let's see how to use them. So here are the files that we have so if you want to
2:56
create a zip file then you can type chip and then you can specify the file name
3:00
of the chip so I going to call it nice and I going to specify the files that I going to create a zip archive file from So I going to use alpha and nano here
3:12
So I can type alpha and nano. So use the tab key to auto complete
3:19
Hit the enter and this will simply create a nice file here
3:23
So this is the file. If you want to include a particular folder, then we can use the same command that is zip
3:29
and I'm going to call it nicer.zip I'm going to specify the folder name that is news and I can
3:37
hit the enter and this will create a zip file from that folder but there is a catch if we just
3:44
use this command it will simply use the folder and it will not include the folder content so any
3:50
files and folder inside that folder will not be included in the zip file that is going to be
3:55
created here which is nicer. So to include the files and folders also you can add a parameter
4:02
of hyphen r so this is recursively navigate to the inside of the folder and add the files and
4:08
folder from there as well. Hit the enter and this has added the news folder and in the news folder
4:14
there are two files and it has added these two files in the zip archive files. Now if I so the
4:20
ls command here you have the nicer zip as well. So this is how you can create the zip files of
4:25
of folders and now let's see how to extract that zip file
4:29
So we have nicer and nice. Let's extract the nice zip file first
4:34
So for that we can use unzip So let me just clear it a bit So we are going to extract this file nice here So for that we can type unzip and the file name that is nice and then we can simply
4:47
hit the enter and this will extract the files. But if you want to extract the file in a particular folder, we can use hyphen d and we can specify
4:54
the folder name. So I'm going to call it ezip and I'm going to hit enter and if I hit Alice, I have this
5:01
eGIF folder here and I can cd to that folder and I can hit the ls and you can see I have these two
5:08
files that are in the daily folder here and similarly you can also extract the above file
5:13
and you can specify the folder name where you want to extract the file so if the folder name is not
5:19
available it will create the folder and extract the content of the gif file into that folder so
5:24
it's relatively easy to use these command line tools to create gif and unzip file so I think
5:30
That's it in this video. I hope you find this video helpful and if you want to get into more detail, then you
5:35
can check out the help page for these two tools. Let me show you
5:43
So if I add the hyphen as as a parameter, you can see it has these many arguments that
5:49
you can pass. So you can read about these in here. Same for unzip here
5:58
So that's it guys. I hope you find this helpful. Do not forget to subscribe to our channel
6:04
Hit the like button. Let me know what you think about it in the comment section below. And I'll catch you in the next one
6:09
Till then take care and keep enjoying Linux
#Software
#Software Utilities
