![]() This is the basic syntax of using the zip command to create a zip archive of a file. Zip command in Linuxįollowing is the syntax for using the zip command once its properly installed. Let’s dive in and see how to zip and unzip files and directories in Linux with zip and unzip command with examples. Open the terminal and execute the beneath command, $ sudo yum install -y zip unzip How to Install Zip/Unzip in RedHa/CentOS/Fedora ![]() Open the terminal and run the following apt command, $ sudo apt install -y zip unzipĪfter installation, you can confirm the version of zip and unzip installed using the command. Install Zip/Unzip in Ubuntu/Debian/Linux Mint In this tutorial, we will show you how to Zip (compress) and Unzip (decompress) files and directories in Linux using the zip and unzip command. On the other hand, unzip is a utility tool that helps you decompress files and folders. Compression of files & folders enables faster and more efficient transfer, storage, and emailing of files and folders. If you have any queries, use the comment section below to reach us.Zip is a command-line utility tool used for compressing files and folders. That’s all! In this short but useful guide, we showed you how to download and extract archive files in one single command. $ sudo curl & sudo tar -xzf -C /etc/nginx/ $ sudo curl | sudo tar -xz -C /etc/nginx/ To extract file to different directory while downloading, use the following command. How to Download and Extract File Using cURL CommandĬonsidering the previous example, this is how you can use cURL to download and unpack archives in the current working directory. $ sudo wget -c & sudo tar -xzf -C /etc/nginx/ ![]() To extract compressed archive file to a specific directory, use the following command. $ sudo wget -c -O - | sudo tar -xz -C /etc/nginx/Īlternatively, you can use the following command, here, the archive file will be downloaded on your system before you can extract it. Note: If extracting files to particular directory that requires root permissions, use the sudo command to run tar. To extract tar files to specific directory, /etc/nginx/ in this case, include use the -C flag as follows. The wget option -O specifies a file to which the documents is written, and here we use -, meaning it will written to standard output and piped to tar and the tar flag -x enables extraction of archive files and -z decompresses, compressed archive files created by gzip. The example below shows how to download, unpack the latest GeoLite2 Country databases (use by the GeoIP Nginx module) in the current directory. ![]() How to Download and Extract File Using Wget Command In this article, we will show you how to download tar archives using two well known command line downloaders – wget or cURL and extract them with one single command. Read Also: 18 Tar Command Examples in Linux It is the most widely used command line utility to create compressed archive files (packages, source code, databases and so much more) that can be transferred easily from machine to another or over a network. It can be used together with gzip (tar.gz) or bzip2 (tar.bz2) for compression. Tar ( Tape Archive) is a popular file archiving format in Linux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |