man-pages/man1/7z.1.html
2021-03-31 01:06:50 +01:00

428 lines
9.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of 7z</TITLE>
</HEAD><BODY>
<H1>7z</H1>
Section: User Commands (1)<BR>Updated: March 6th, 2016<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
7z - A file archiver with high compression ratio format
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>7z</B>
<B>&lt;command&gt;</B>
[<B>&lt;switches&gt;</B>... ]
<B>&lt;archive_name&gt;</B>
[<B>&lt;file_names&gt;</B>... ]
[<B>&lt;@listfiles&gt;</B>... ]
<P>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
7-Zip is a file archiver supporting 7z (that implements LZMA compression algorithm
featuring very high compression ratio), LZMA2, XZ, ZIP, Zip64, CAB,
RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO,
most filesystem images and DEB formats.
Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format.
<P>
<B>7z</B>
uses plugins to handle archives, so it might be slightly slower than
<B><A HREF="/cgi-bin/man/man2html?1+7za">7za</A></B>(1)
but can handle more archive formats.
<A NAME="lbAE">&nbsp;</A>
<H2>COMMANDS</H2>
<DL COMPACT>
<DT id="1"><B>a</B>
<DD>
Add files to archive
<DT id="2"><B>b</B>
<DD>
Benchmark
<DT id="3"><B>d</B>
<DD>
Delete files from archive
<DT id="4"><B>e</B>
<DD>
Extract files from archive (without using directory names)
<DT id="5"><B>h</B>
<DD>
Calculate hash values for files
<DT id="6"><B>i</B>
<DD>
Show information about supported formats
<DT id="7"><B>l</B>
<DD>
List contents of archive
<DT id="8"><B>rn</B>
<DD>
Rename files in archive
<DT id="9"><B>t</B>
<DD>
Test integrity of archive
<DT id="10"><B>u</B>
<DD>
Update files to archive
<DT id="11"><B>x</B>
<DD>
eXtract files with full paths
</DL>
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>SWITCHES</H2>
<DL COMPACT>
<DT id="12"><B>--</B>
<DD>
Stop switches parsing
<DT id="13"><B>-ai[r[-|0]]{@listfile|!wildcard}</B>
<DD>
Include archives
<DT id="14"><B>-ax[r[-|0]]{@listfile|!wildcard}</B>
<DD>
Exclude archives
<DT id="15"><B>-ao{a|s|t|u}</B>
<DD>
Set Overwrite mode
<DT id="16"><B>-an</B>
<DD>
Disable archive_name field
<DT id="17"><B>-bb[0-3]</B>
<DD>
Set output log level
<DT id="18"><B>-bd</B>
<DD>
Disable progress indicator
<DT id="19"><B>-bs{o|e|p}{0|1|2}</B>
<DD>
Set output stream for output/error/progress line
<DT id="20"><B>-bt</B>
<DD>
Show execution time statistics
<DT id="21"><B>-i[r[-|0]]{@listfile|!wildcard}</B>
<DD>
Include filenames
<DT id="22"><B>-m{Parameters}</B>
<DD>
Set Compression Method (see /usr/share/doc/p7zip/DOC/MANUAL/cmdline/switches/method.htm from the p7zip-full package for a list of methods)
<DT id="23"><B>-o{Directory}</B>
<DD>
Set Output directory
<DT id="24"><B>-p{Password}</B>
<DD>
Set Password (NOTE: this flag does not work with 7zr)
<DT id="25"><B>-r[-|0]</B>
<DD>
Recurse subdirectories (CAUTION: this flag does not do what you think, avoid using it)
<DT id="26"><B>-sa{a|e|s}</B>
<DD>
Set archive name mode
<DT id="27"><B>-scc{UTF-8|WIN|DOS}</B>
<DD>
Set charset for for console input/output
<DT id="28"><B>-scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}}</B>
<DD>
Set charset for list files
<DT id="29"><B>-scrc[CRC32|CRC64|SHA1|SHA256|*]</B>
<DD>
Set hash function for x, e, h commands
<DT id="30"><B>-sdel</B>
<DD>
Delete files after compression
<DT id="31"><B>-seml[.]</B>
<DD>
Send archive by email
<DT id="32"><B>-sfx[{name}]</B>
<DD>
Create SFX archive
<DT id="33"><B>-si[{name}]</B>
<DD>
Read data from stdin (e.g. tar cf - directory | 7z a -si directory.tar.7z)
<DT id="34"><B>-slp</B>
<DD>
Set Large Pages mode
<DT id="35"><B>-slt</B>
<DD>
Show technical information for l (List) command
<DT id="36"><B>-snh</B>
<DD>
Store hard links as links
<DT id="37"><B>-snl</B>
<DD>
Store symbolic links as links
<DT id="38"><B>-sni</B>
<DD>
Store NT security information
<DT id="39"><B>-sns[-]</B>
<DD>
Store NTFS alternate streams
<DT id="40"><B>-sfx[{name}]</B>
<DD>
Create SFX archive
<DT id="41"><B>-so</B>
<DD>
Write data to stdout (e.g. 7z x -so directory.tar.7z | tar xf -)
<DT id="42"><B>-spd</B>
<DD>
Disable wildcard matching for file names
<DT id="43"><B>-spe</B>
<DD>
Eliminate duplication of root folder for extract command
<DT id="44"><B>-spf</B>
<DD>
Use fully qualified file paths
<DT id="45"><B>-ssc[-]</B>
<DD>
Set sensitive case mode
<DT id="46"><B>-ssw</B>
<DD>
Compress shared files
<DT id="47"><B>-stl</B>
<DD>
Set archive timestamp from the most recently modified file
<DT id="48"><B>-stm{HexMask}</B>
<DD>
Set CPU thread affinity mask (hexadecimal number)
<DT id="49"><B>-stx{Type}</B>
<DD>
Exclude archive type
<DT id="50"><B>-t{Type}</B>
<DD>
Set type of archive
<DT id="51"><B>-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]</B>
<DD>
Update options
<DT id="52"><B>-v{Size}[b|k|m|g]</B>
<DD>
Create volumes
<DT id="53"><B>-w[path]</B>
<DD>
Set working directory. Empty path means a temporary directory
<DT id="54"><B>-x[r[-|0]]]{@listfile|!wildcard}</B>
<DD>
Exclude filenames
<DT id="55"><B>-y</B>
<DD>
Assume Yes on all queries
</DL>
<P>
<A NAME="lbAG">&nbsp;</A>
<H2>DIAGNOSTICS</H2>
7-Zip returns the following exit codes:
<DL COMPACT><DT id="56"><DD>
<DL COMPACT>
<DT id="57">0<DD>
Normal (no errors or warnings detected)
<DT id="58">1<DD>
Warning (Non fatal error(s)). For example, some files cannot be read during compressing,
so they were not compressed
<DT id="59">2<DD>
Fatal error
<DT id="60">7<DD>
Bad command line parameters
<DT id="61">8<DD>
Not enough memory for operation
<DT id="62">255<DD>
User stopped the process with control-C (or similar)
</DL>
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>Backup and limitations</H2>
DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :
<BR>&nbsp;-&nbsp;7-zip&nbsp;does&nbsp;not&nbsp;store&nbsp;the&nbsp;owner/group&nbsp;of&nbsp;the&nbsp;file.
<P>
<P>
On Linux/Unix, in order to backup directories you must use tar :
<BR>&nbsp;-&nbsp;to&nbsp;backup&nbsp;a&nbsp;directory&nbsp;&nbsp;:&nbsp;tar&nbsp;cf&nbsp;-&nbsp;directory&nbsp;|&nbsp;7z&nbsp;a&nbsp;-si&nbsp;directory.tar.7z
<BR>&nbsp;-&nbsp;to&nbsp;restore&nbsp;your&nbsp;backup&nbsp;:&nbsp;7z&nbsp;x&nbsp;-so&nbsp;directory.tar.7z&nbsp;|&nbsp;tar&nbsp;xf&nbsp;-
<P>
If you want to send files and directories (not the owner of file)
to others Unix/MacOS/Windows users, you can use the 7-zip format.
<P>
<BR>&nbsp;&nbsp;example&nbsp;:&nbsp;7z&nbsp;a&nbsp;directory.7z&nbsp;&nbsp;directory
<P>
<P>
Do not use &quot;-r&quot; because this flag does not do what you think.
<P>
Do not use directory/* because of &quot;.*&quot; files (example : &quot;directory/*&quot; does not match &quot;directory/.profile&quot;)
<A NAME="lbAI">&nbsp;</A>
<H2>EXAMPLE 1</H2>
<DL COMPACT>
<DT id="63"><B>7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1</B>
<DD>
adds all files from directory &quot;dir1&quot; to archive archive.7z using &quot;ultra settings&quot;
<DT id="64"><B>-t7z</B>
<DD>
7z archive
<DT id="65"><B>-m0=lzma</B>
<DD>
lzma method
<DT id="66"><B>-mx=9</B>
<DD>
level of compression = 9 (Ultra)
<DT id="67"><B>-mfb=64</B>
<DD>
number of fast bytes for LZMA = 64
<DT id="68"><B>-md=32m</B>
<DD>
dictionary size = 32 megabytes
<DT id="69"><B>-ms=on</B>
<DD>
solid archive = on
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>EXAMPLE 2</H2>
<DL COMPACT>
<DT id="70"><B>7z a -sfx archive.exe dir1</B>
<DD>
add all files from directory &quot;dir1&quot; to SFX archive archive.exe (Remark : SFX archive MUST end with &quot;.exe&quot;)
</DL>
<A NAME="lbAK">&nbsp;</A>
<H2>EXAMPLE 3</H2>
<DL COMPACT>
<DT id="71"><B>7z a -mhe=on -pmy_password archive.7z a_directory</B>
<DD>
add all files from directory &quot;a_directory&quot; to the archive &quot;archive.7z&quot; (with data and header archive encryption on)
</DL>
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+7zr">7zr</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+7za">7za</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+p7zip">p7zip</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+bzip2">bzip2</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+gzip">gzip</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+zip">zip</A>(1),</B>
<P>
<A NAME="lbAM">&nbsp;</A>
<H2>HTML Documentation</H2>
/usr/share/doc/p7zip-full/DOC/MANUAL/start.htm
<A NAME="lbAN">&nbsp;</A>
<H2>AUTHOR</H2>
<DL COMPACT>
<DT id="72">Written for Debian by Mohammed Adnene Trojette. Updated by Robert Luberda.<DD>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="73"><A HREF="#lbAB">NAME</A><DD>
<DT id="74"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="75"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="76"><A HREF="#lbAE">COMMANDS</A><DD>
<DT id="77"><A HREF="#lbAF">SWITCHES</A><DD>
<DT id="78"><A HREF="#lbAG">DIAGNOSTICS</A><DD>
<DT id="79"><A HREF="#lbAH">Backup and limitations</A><DD>
<DT id="80"><A HREF="#lbAI">EXAMPLE 1</A><DD>
<DT id="81"><A HREF="#lbAJ">EXAMPLE 2</A><DD>
<DT id="82"><A HREF="#lbAK">EXAMPLE 3</A><DD>
<DT id="83"><A HREF="#lbAL">SEE ALSO</A><DD>
<DT id="84"><A HREF="#lbAM">HTML Documentation</A><DD>
<DT id="85"><A HREF="#lbAN">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:06 GMT, March 31, 2021
</BODY>
</HTML>