Skip to main content
LinuxTips

How to create and extract archives via SSH

By July 15, 2018September 25th, 2019No Comments

Sometimes you would need to extract or create an archive file, i.e to install a script, you would usually download an archive and extract it to continue the installation. The very first step in the process would be to identify the exact archive type by looking at the file extension. The most common archive types are zip (ending with .zip), tar (.tar), Tar+Gunzip (.tar.gz), Bzip (.bz2) and Rar (.rar).

Each archive type has its own command for compressing/extracting as listed below.

 

To extract a ZIP file, you can use:

unzip archive.zip

To extract a Tar file, you can use:

tar -xvf archive.tar

To extract a Tar.Gz file, you can use:

tar -zxvf archive.tar.gz

To extract a Rar file, you can use:

rar x archive.rar

 

Each archive type has its own mechanism to create a new archive file. The most commonly used however is the tar.gz format. An example of creating such a file is:

tar -zcf archive-name.tar.gz foldername/
Sebastián Becerra

Sebastián Becerra

Trabajo con tecnologías web en arquitecturas Cloud. Me gusta descubrir y aprender nuevas tecnologías en Layouts (CSS, Sass, Less), Frameworks de Desarrollo (JQuery, AngularJS, Ionic) y plataformas Web (Wordpress, Joomla, Prestashop). He colaborado con diferentes proyectos de software libre y código abierto con fines sociales. Además participé en distintos eventos TI exponiendo sobre comunidades y educando sobre tecnologías Web.

Leave a Reply