Unzip File Mac Command Line



The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

  1. Unzip Gz File Mac Command Line
  2. Unzip Bz2 File Mac Command Line

The AWS CLI v2 offers several new features including improved installers, new configuration options such as AWS Single Sign-On (SSO), and various interactive features.

Windows
Download and run the 64-bit Windows installer.

MacOS
Download and run the MacOS PKG installer.

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts. Zip files can be opened in Mac OS, Windows and Linux. You can also create Zip files from Mac OS, Windows, and Linux and open it in other operating systems. On Linux based operating systems such as CentOS, the unzip command is used to open Zip files. In this article I will show you how to use the unzip command to open Zip files on CentOS.

Linux
Download, unzip, and then run the Linux installer

Amazon Linux
The AWS CLI comes pre-installed on Amazon Linux AMI.

Release Notes
Check out the Release Notes for more information on the latest version.

Command

aws-shell is a command-line shell program that provides convenience and productivity features to help both new and advanced users of the AWS Command Line Interface. Key features include the following.

  • Fuzzy auto-completion for
    • Commands (e.g. ec2, describe-instances, sqs, create-queue)
    • Options (e.g. --instance-ids, --queue-url)
    • Resource identifiers (e.g. Amazon EC2 instance IDs, Amazon SQS queue URLs, Amazon SNS topic names)
  • Dynamic in-line documentation
    • Documentation for commands and options are displayed as you type
  • Execution of OS shell commands
    • Use common OS commands such as cat, ls, and cp and pipe inputs and outputs without leaving the shell
  • Export executed commands to a text editor

To find out more, check out the related blog post on the AWS Command Line Interface blog.

The AWS Command Line Interface User Guide walks you through installing and configuring the tool. After that, you can begin making calls to your AWS services from the command line.

You can get help on the command line to see the supported services,

New file commands make it easy to manage your Amazon S3 objects. Using familiar syntax, you can view the contents of your S3 buckets in a directory-based listing.

You can perform recursive uploads and downloads of multiple files in a single folder-level command. The AWS CLI will run these transfers in parallel for increased performance.

A sync command makes it easy to synchronize the contents of a local folder with a copy in an S3 bucket.

See the AWS CLI command reference for the full list of supported services.

Connect with other developers in the AWS CLI Community Forum »

Find examples and more in the User Guide »

Learn the details of the latest CLI tools in the Release Notes »

Dig through the source code in the GitHub Repository »

Zip is a file compression utility. It is the default file compression utility on Windows and widely used in Windows operating system. The Zip compressed files are also called zip files. The best thing about Zip is that it is cross platform. Zip files can be opened in Mac OS, Windows and Linux. You can also create Zip files from Mac OS, Windows, and Linux and open it in other operating systems.

On Linux based operating systems such as CentOS, the unzip command is used to open Zip files.

In this article I will show you how to use the unzip command to open Zip files on CentOS. I am going to use CentOS 7 for the demonstration. Let’s get started.

On CentOS 7, the unzip package may not be installed by default. But it is available in the official package repository of CentOS 7. So it is very easy to install.

First update the YUM package repository cache with the following command:

The YUM package repository cache should be updated.

Now install unzip with the following command:

Now press y and then press <Enter> to continue.

unzip should be installed.

Now to check whether unzip works, run the following command:

As you can see, unzip is working perfectly.

Working with Zip Files Using Graphical User Interface:

If you have graphical desktop environment such as GNOME desktop environment installed on your CentOS operating system, then working with Zip files is pretty easy.

As you can see, I have app.zip file in the ~/Downloads directory of my HOME directory.

Now if you right click on the zip file, you should be able to see the following options. The first option is Open With Archive Manager. If you double click on a Zip file, it will open with the Archive Manager by default.

Unzip Gz File Mac Command Line

You can also click on Extract Here to extract the zip file.

File

As you can see, the zip file is opened in the Archive Manager and I can see all the contents of the Zip file.

From the Archive Manager, you can click on Extract to extract the contents of the Zip file.

You should see the following window. You can click on the Extract button to extract the Zip file in the current directory. If you wish, you can create a new folder and extract the contents of the Zip file there.

I create a new directory myapp/ and extracted the contents of the Zip file there.

As you can see, the contents of the Zip file are correctly extracted into the myapp/ directory.

You can also select specific files and folders from the Archive Manager and drag and drop them on a directory. Only your desired files and folders will be extracted.

Listing the Contents of the Zip file using unzip Command:

Unzip Bz2 File Mac Command Line

You can list all the files and directories stored inside a Zip file with the following command:

As you can see, all the contents of the Zip archive app.zip is listed.

Unzip multiple files mac command line

Extracting a Zip File using unzip Command:

You can extract a Zip file using the unzip command very easily.

To extract a Zip file into the current directory where the zip file is, run the following command:

NOTE: Here app.zip is the Zip file that I am extracting.

Line

The contents of the Zip file should be extracted to your current working directory.

As you can see, all the files and directories of app.zip is extracted.

In the earlier example, all the files were extracted in the current directory. You may want to extract the contents of the Zip file to any specific directory. You can also do that with the unzip command.

First create the directory where you will be extracting the Zip file with the following command:

Now run the following command to extract the Zip file app.zip into the

~/Downloads/myapp directory:
$ unzip app.zip -d ~/Downloads/myapp

The contents of the app.zip file is extracted into the ~/Downloads/myapp directory as you can see in the screenshot below.

The ls command also verifies that the Zip file was extracted in the desired directory.

Extracting Specific Files from the Zip File using unzip Command:

You can also extract specific files and directories from the Zip file using unzip command.

For example, let’s say you want to extract only server.js file from app.zip file, run the following command:

As you can see, only server.js was extracted to the current working directory.

You can also specify a directory where the files and directories should be extracted as follows:

You can also extract a specific subdirectory from the Zip file as follows:

As you can see the directory models/ and all the contents of the directory was extracted into the ~/Downloads/myapp directory.

That’s how you use Unzip on CentOS. Thanks for reading this article.