theshell.ch/site/pages/cmd/interm/7z.html

65 lines
1.4 KiB
HTML
Raw Normal View History

---
layout: page
category-title: Intermediate commands
category-page: intermediate
tags:
author: Andrea Brites Marto
title: 7z
---
<p>
A .7z. file is an archive format that stands for 7-zip. By default, Mac OS X does not know how to handle these files, but that is not a big deal because you can download for free in App Store. The program supports 7z, ZIP, CAB, ARJ, BZIP2, TAR, CPIO, RPM and DEB.<br>
So, first of all, you need to download Unarchiver in order to use this command.<br>
The basic syntax is:
<pre>
7z [adeltux] [-] [SWITCH] <code>&lt;ARCHIVE_NAME&gt; &lt;ARGUMENTS&gt;</code>
</pre>
Here some useful options that we will use to explain some examples:
<ul>
<li><code>a</code> Add</li>
<li><code>d</code> Delete</li>
<li><code>e</code> Extract</li>
<li><code>l</code> List</li>
<li><code>t</code> Test</li>
<li><code>u</code> Update</li>
<li><code>x</code> Extract with full paths</li>
</ul>
The simplest way to use <code>7z</code> if we want to extracts all files from archive archive.zip to the current directory.
<pre>
7z e archive.zip
</pre>
Well, now we talk about the switches.
There are many type of switches, we will see the most common ones.<br>
-m (Set compression Method)
<pre>
-m&lt;method_parameters&gt;
</pre>
The format for this switch depends on the archive type which are:
<ul>
<li>Zip</li>
<li>GZip</li>
<li>BZip2</li>
<li>7z</li>
<li>XZ</li>
<li>WIM</li>
</ul>
</p>