特殊:Badtitle/NS100:FileCompression:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的9个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/FileCompression}} | {{From|https://help.ubuntu.com/community/FileCompression}} | ||
{{Languages|UbuntuHelp:FileCompression}} | {{Languages|UbuntuHelp:FileCompression}} | ||
Parent: AccessoriesApplications | Parent: [[UbuntuHelp:AccessoriesApplications|AccessoriesApplications]] | ||
== File compression == | |||
Files can be compressed in a variety of formats. Some of these can be opened by Ubuntu automatically. Others can be handled if you install extra packages. | Files can be compressed in a variety of formats. Some of these can be opened by Ubuntu automatically. Others can be handled if you install extra packages. | ||
=== Basic Archives === | === Basic Archives === | ||
* Many archives can easily be opened using Archive Manager. | |||
Many archives | * Right click an archive and select "Extract Here" to extract the files into the '''''current working directory'''''. | ||
* For more fine grained control choose 'Open with "Archive Manager" ' from the popup menu. <<BR>> | |||
https://help.ubuntu.com/community/FileCompression?action=AttachFile&do=get&target=extracthere. | https://help.ubuntu.com/community/FileCompression?action=AttachFile&do=get&target=extracthere.png | ||
* Double clicking on an archive will open it with Archive Manager. This achieves the same thing as right clicking the archive and selecting 'Open with "Archive Manager" '.<<BR>> | |||
Double | https://help.ubuntu.com/community/FileCompression?action=AttachFile&do=get&target=archivemanager2.png | ||
https://help.ubuntu.com/community/FileCompression?action=AttachFile&do=get&target= | For more complete information on supported formats and usage please see [[UbuntuHelp:ArchiveManager|Archive Manager]]. | ||
=== Non-archive formats === | === Non-archive formats === | ||
{|border="1" cellspacing="0" | |||
|https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=info.png Archive Manager can open some formats that are not technically considered as archives. | |||
|} | |||
==== Debian installer packages (.deb) ==== | |||
* DEB files are actually programs that need to be installed. | |||
* If you are using Ubuntu 6.06 Dapper Drake or higher, you can double click ''.deb'' files to install them. You can also right click and select 'Open with GDebi Package Installer" '. | |||
* https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png [[UbuntuHelp:UsingTheTerminal|Command line installation]] | |||
<ol><li>Open a terminal. | |||
</li><li>Navigate to the directory containing the ''.deb'' file. | |||
</li><li>Enter this command. Replace <filename.deb> with the name of the actual file you are installing.</li></ol> | |||
<pre><nowiki> | |||
sudo dpkg -i <filename.deb></nowiki></pre> | |||
{|border="1" cellspacing="0" | |||
| https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png Installing programs from untrustworthy sources can seriously damage your system. Manually installing programs may also cause dependency problems. | |||
|} | |||
==== CD Images (.iso) ==== | ==== CD Images (.iso) ==== | ||
* ISO images are images to be burned on to a CD. See [[UbuntuHelp:BurningIsoHowto|BurningIsoHowto]] for further information on burning an ''.iso'' file. | |||
* ISO images can also be mounted. See [[UbuntuHelp:MountIso|MountIso]] for more information. | |||
==== Java Archives (.jar) ==== | ==== Java Archives (.jar) ==== | ||
* JAR files are java programs. See [[UbuntuHelp:Java|Java]]. | |||
==== Firefox extensions (.xpi) ==== | ==== Firefox extensions (.xpi) ==== | ||
* XPI files are extensions for Mozilla Firefox. | |||
<ol><li>Launch Firefox and select '''File -> Open File'''. | |||
</li><li>Select the ''.xpi'' file and press the "Open" button. Firefox will then install the extension.</li></ol> | |||
{|border="1" cellspacing="0" | |||
| https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png Installing certain extensions may damage your Firefox profile. | |||
|} | |||
=== Archive formats === | === Archive formats === | ||
==== 7zip (.7z) ==== | ==== 7zip (.7z) ==== | ||
Archive Manager supports the 7zip compression format. | |||
7zip | * Install the package <code><nowiki>p7zip</nowiki></code> from the [[UbuntuHelp:AddingRepositoriesHowto|Universe repository]]. After installation of the package, Archive manager will handle 7z archives seamlessly. | ||
* In order to support password-protected 7z archives, you need to install the <code><nowiki>p7zip-full</nowiki></code> package from the Universe repository. | |||
Install the package <code><nowiki>p7zip</nowiki></code> from the Universe repository | |||
==== Ace (.ace) ==== | ==== Ace (.ace) ==== | ||
* This uncommon format is extracted using the 'unace' utility. Install <code><nowiki>unace</nowiki></code> from the [[UbuntuHelp:AddingRepositoriesHowto|Universe repository]]. | |||
* ACE archives are not supported by Archive Manager. You must open then from the command line. | |||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png <pre><nowiki> | |||
unace x <filename>.ace | |||
<pre><nowiki> | |||
unace x | |||
</nowiki></pre> | </nowiki></pre> | ||
* If you encounter error messages, the file you are trying to decompress is too new for version of unace in repositories. Go to [http://www.winace.com the developer's site] and download "Unace for Linux". Extract the unace binary from the archive and replace your current version of unace. | |||
If you encounter | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo mv /location/of/ | sudo mv /location/of/new/unace /usr/local/bin/unace | ||
</nowiki></pre> | </nowiki></pre> | ||
==== Rar (.rar) ==== | ==== Rar (.rar) ==== | ||
* Rar is a non-free archive format created by Rarsoft. Version 3.0 is not supported by any free tools. | |||
Rar is a non-free archive format created by Rarsoft. | * The free program <code><nowiki>unrar-free</nowiki></code>, supports rar up to Version 2. | ||
* Package <code><nowiki>unrar-free</nowiki></code> is available in the [[UbuntuHelp:AddingRepositoriesHowto|Universe repository]]. | |||
To add support for | * To add support for rar version 3, install the <code><nowiki>unrar</nowiki></code> package from the [[UbuntuHelp:AddingRepositoriesHowto|Multiverse repository]]. | ||
===== Multi-volume .rar archives ===== | ===== Multi-volume .rar archives ===== | ||
To extract the contents of a multi-volume .rar archive, extract the first file in the archive. Usually | * To extract the contents of a multi-volume ''.rar'' archive, extract the first file in the archive. Usually the extension will be ''.rar'', ''.r00'', or ''.r01''. | ||
==== GNU Tar (.tar) ==== | ==== GNU Tar (.tar) ==== | ||
* The ''.tar'' archive is an old archive format made for tapes. TAR archives consist of files that are sequentially added to a single file. | |||
* TAR archives can be extracted using Archive Manager. | |||
The tar archive is an old archive format made for tapes | * TAR archives can also be extracted from the command line. See <code><nowiki>man tar</nowiki></code> for more information on command line usage. | ||
==== GNU Tar GZ (.tar.gz .tgz) ==== | ==== GNU Tar GZ (.tar.gz .tgz) ==== | ||
* A Tar GZ archive is a gzip compressed ''.tar'' archive. | |||
* Tar GZ archives can be extracted with Archive Manager. | |||
* Tar GZ archives can also be extracted from the command line. See <code><nowiki>man tar</nowiki></code> for more information on command line usage. | |||
==== GNU Tar bzip2 (.tar.bz2) ==== | ==== GNU Tar bzip2 (.tar.bz2) ==== | ||
* Tar BZ2 archives are bzip2 compressed ''.tar'' archives. | |||
{|border="1" cellspacing="0" | |||
|https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconHint2.png Bzip2 compressed archives are smaller than gzip archives. The trade off is that bzip compression requires more processing power than gzip compression. | |||
|} | |||
* Tar BZ2 archives can be extracted with Archive Manager. | |||
* Tar BZ2 archives can also be extracted from the command line. See <code><nowiki>man tar</nowiki></code> for more information on command line usage. | |||
==== GNU Tar Compress (.tar.Z) ==== | |||
* A Tar Compress'd archive is a compress (.Z) compressed ''.tar'' archive. | |||
* Tar Compress'd archives can be extracted with Archive Manager. | |||
* Install the package <code><nowiki>ncompress</nowiki></code> from the [[UbuntuHelp:AddingRepositoriesHowto|Universe repository]]. After installation of the package, Archive manager will handle compress (.Z) archives seamlessly. | |||
* Tar Compress'd archives can also be extracted from the command line (after you have installed the <code><nowiki>ncompress</nowiki></code> package). See <code><nowiki>man tar</nowiki></code> for more information on command line usage. | |||
==== Zip (.zip) ==== | ==== Zip (.zip) ==== | ||
This is an older archive | * This is an older archive and compression format that originates with PKZip. It was developed by Phil Katz in 1989. | ||
* ZIP files can be extracted with Archive Manager. | |||
=== Command Line Usage === | === Command Line Usage === | ||
Many of | * https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=terminal.png Many of the above utilities can be used quickly and efficiently from the command line. This section will briefly cover common command line usage for these utilities. Replace <filename> with the name of your file. | ||
* In most cases you can replace the filename with the complete path to the file. | |||
{|border="1" cellspacing="0" | |||
|https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconHint2.png Using a full path is useful when scripting. | |||
|} | |||
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=example.png <pre><nowiki> | |||
tar -czpf /home/me/somefile.tar.gz /path/to/files/to/be/archived</nowiki></pre> | |||
==== Extracting a tar.bz2 file ==== | ==== Extracting a tar.bz2 file ==== | ||
* Extract <filename>tar.bz2 <pre><nowiki> | |||
<pre><nowiki> | tar jxvf <filename>.tar.bz2 | ||
tar jxvf | |||
</nowiki></pre> | </nowiki></pre> | ||
This will show you what it extracts, and in most cases will | * This will show you what it extracts, and in most cases will create a directory named <filename>. | ||
* To extract a <code><nowiki>tar.gz</nowiki></code>, simply put <code><nowiki>z</nowiki></code> in place of <code><nowiki>j</nowiki></code> in the command line. For more information please refer to <code><nowiki>man tar</nowiki></code>. | |||
To extract a <code><nowiki>tar.gz</nowiki></code>, simply put <code><nowiki> | |||
==== Creating a tar.bz2 file ==== | ==== Creating a tar.bz2 file ==== | ||
* <pre><nowiki> | |||
<pre><nowiki> | tar jcvf <filename>.tar.bz2 dir1 dir2 file1 file2 ... | ||
tar jcvf | |||
</nowiki></pre> | </nowiki></pre> | ||
* <filename>.tar.bz2 is the name of the tar file we wish to create. <code><nowiki>dir#</nowiki></code> and <code><nowiki>file#</nowiki></code> are the names of the directories or files we wish to include in the ''tar.bz2'' archive. | |||
* To use gzip compression instead of bz2, simply put <code><nowiki>z</nowiki></code> in place of <code><nowiki>j</nowiki></code> in the command line. | |||
To use gzip compression instead of bz2, simply put <code><nowiki> | For more information please refer to <code><nowiki>man tar</nowiki></code>. | ||
==== Rar ==== | ==== Rar ==== | ||
* Rar v3.0 archives require the use of <code><nowiki>unrar</nowiki></code>. | |||
===== unrar-free ===== | |||
* Extract ''<filename>.rar'' <pre><nowiki> | |||
unrar-free <filename>.rar | |||
</nowiki></pre> | |||
* If extracting fails with a message like the following, try the non-free version. | |||
<pre><nowiki> | <pre><nowiki> | ||
unrar x | Extracting file1.ext Failed | ||
Extracting file2.ext Failed | |||
2 Failed | |||
</nowiki></pre> | |||
===== unrar-nonfree ===== | |||
* Extract ''<filename>.rar'' <pre><nowiki> | |||
unrar x <filename>.rar | |||
</nowiki></pre> | </nowiki></pre> | ||
==== zip and unzip ==== | ==== zip and unzip ==== | ||
To create a zip file containing <code><nowiki>dir1</nowiki></code>, <code><nowiki>dir2</nowiki></code>, ...: | * To create a zip file containing <code><nowiki>dir1</nowiki></code>, <code><nowiki>dir2</nowiki></code>, ... : | ||
<pre><nowiki> | <pre><nowiki> | ||
zip | zip <filename>.zip dir1 dir1 ... | ||
</nowiki></pre> | </nowiki></pre> | ||
* To extract <filename>.zip: | |||
To extract < | |||
<pre><nowiki> | <pre><nowiki> | ||
unzip | unzip <filename>.zip | ||
</nowiki></pre> | </nowiki></pre> | ||
---- | |||
[[category:CategoryCommandLine]] [[category:CategoryBackupRecovery]] | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年5月14日 (四) 15:59的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/FileCompression }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/af | • {{#if: UbuntuHelp:FileCompression|Afrikaans| [[::FileCompression/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ar | • {{#if: UbuntuHelp:FileCompression|العربية| [[::FileCompression/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/az | • {{#if: UbuntuHelp:FileCompression|azərbaycanca| [[::FileCompression/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/bcc | • {{#if: UbuntuHelp:FileCompression|جهلسری بلوچی| [[::FileCompression/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/bg | • {{#if: UbuntuHelp:FileCompression|български| [[::FileCompression/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/br | • {{#if: UbuntuHelp:FileCompression|brezhoneg| [[::FileCompression/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ca | • {{#if: UbuntuHelp:FileCompression|català| [[::FileCompression/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/cs | • {{#if: UbuntuHelp:FileCompression|čeština| [[::FileCompression/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/de | • {{#if: UbuntuHelp:FileCompression|Deutsch| [[::FileCompression/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/el | • {{#if: UbuntuHelp:FileCompression|Ελληνικά| [[::FileCompression/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/es | • {{#if: UbuntuHelp:FileCompression|español| [[::FileCompression/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/fa | • {{#if: UbuntuHelp:FileCompression|فارسی| [[::FileCompression/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/fi | • {{#if: UbuntuHelp:FileCompression|suomi| [[::FileCompression/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/fr | • {{#if: UbuntuHelp:FileCompression|français| [[::FileCompression/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/gu | • {{#if: UbuntuHelp:FileCompression|ગુજરાતી| [[::FileCompression/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/he | • {{#if: UbuntuHelp:FileCompression|עברית| [[::FileCompression/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/hu | • {{#if: UbuntuHelp:FileCompression|magyar| [[::FileCompression/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/id | • {{#if: UbuntuHelp:FileCompression|Bahasa Indonesia| [[::FileCompression/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/it | • {{#if: UbuntuHelp:FileCompression|italiano| [[::FileCompression/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ja | • {{#if: UbuntuHelp:FileCompression|日本語| [[::FileCompression/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ko | • {{#if: UbuntuHelp:FileCompression|한국어| [[::FileCompression/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ksh | • {{#if: UbuntuHelp:FileCompression|Ripoarisch| [[::FileCompression/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/mr | • {{#if: UbuntuHelp:FileCompression|मराठी| [[::FileCompression/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ms | • {{#if: UbuntuHelp:FileCompression|Bahasa Melayu| [[::FileCompression/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/nl | • {{#if: UbuntuHelp:FileCompression|Nederlands| [[::FileCompression/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/no | • {{#if: UbuntuHelp:FileCompression|norsk| [[::FileCompression/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/oc | • {{#if: UbuntuHelp:FileCompression|occitan| [[::FileCompression/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/pl | • {{#if: UbuntuHelp:FileCompression|polski| [[::FileCompression/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/pt | • {{#if: UbuntuHelp:FileCompression|português| [[::FileCompression/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ro | • {{#if: UbuntuHelp:FileCompression|română| [[::FileCompression/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/ru | • {{#if: UbuntuHelp:FileCompression|русский| [[::FileCompression/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/si | • {{#if: UbuntuHelp:FileCompression|සිංහල| [[::FileCompression/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/sq | • {{#if: UbuntuHelp:FileCompression|shqip| [[::FileCompression/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/sr | • {{#if: UbuntuHelp:FileCompression|српски / srpski| [[::FileCompression/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/sv | • {{#if: UbuntuHelp:FileCompression|svenska| [[::FileCompression/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/th | • {{#if: UbuntuHelp:FileCompression|ไทย| [[::FileCompression/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/tr | • {{#if: UbuntuHelp:FileCompression|Türkçe| [[::FileCompression/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/vi | • {{#if: UbuntuHelp:FileCompression|Tiếng Việt| [[::FileCompression/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/yue | • {{#if: UbuntuHelp:FileCompression|粵語| [[::FileCompression/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/zh | • {{#if: UbuntuHelp:FileCompression|中文| [[::FileCompression/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/zh-hans | • {{#if: UbuntuHelp:FileCompression|中文(简体)| [[::FileCompression/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:FileCompression | UbuntuHelp:FileCompression | {{#if: | :}}FileCompression}}/zh-hant | • {{#if: UbuntuHelp:FileCompression|中文(繁體)| [[::FileCompression/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:FileCompression|:FileCompression|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :FileCompression/zh | | {{#ifexist: FileCompression/zh | | {{#ifeq: {{#titleparts:FileCompression|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:FileCompression|1|-1|}} | zh | | }}
Parent: AccessoriesApplications
File compression
Files can be compressed in a variety of formats. Some of these can be opened by Ubuntu automatically. Others can be handled if you install extra packages.
Basic Archives
- Many archives can easily be opened using Archive Manager.
- Right click an archive and select "Extract Here" to extract the files into the current working directory.
- For more fine grained control choose 'Open with "Archive Manager" ' from the popup menu. <
>
- Double clicking on an archive will open it with Archive Manager. This achieves the same thing as right clicking the archive and selecting 'Open with "Archive Manager" '.<
>
For more complete information on supported formats and usage please see Archive Manager.
Non-archive formats
Archive Manager can open some formats that are not technically considered as archives. |
Debian installer packages (.deb)
- DEB files are actually programs that need to be installed.
- If you are using Ubuntu 6.06 Dapper Drake or higher, you can double click .deb files to install them. You can also right click and select 'Open with GDebi Package Installer" '.
- Command line installation
- Open a terminal.
- Navigate to the directory containing the .deb file.
- Enter this command. Replace <filename.deb> with the name of the actual file you are installing.
sudo dpkg -i <filename.deb>
Installing programs from untrustworthy sources can seriously damage your system. Manually installing programs may also cause dependency problems. |
CD Images (.iso)
- ISO images are images to be burned on to a CD. See BurningIsoHowto for further information on burning an .iso file.
- ISO images can also be mounted. See MountIso for more information.
Java Archives (.jar)
- JAR files are java programs. See Java.
Firefox extensions (.xpi)
- XPI files are extensions for Mozilla Firefox.
- Launch Firefox and select File -> Open File.
- Select the .xpi file and press the "Open" button. Firefox will then install the extension.
Installing certain extensions may damage your Firefox profile. |
Archive formats
7zip (.7z)
Archive Manager supports the 7zip compression format.
- Install the package
p7zip
from the Universe repository. After installation of the package, Archive manager will handle 7z archives seamlessly. - In order to support password-protected 7z archives, you need to install the
p7zip-full
package from the Universe repository.
Ace (.ace)
- This uncommon format is extracted using the 'unace' utility. Install
unace
from the Universe repository. - ACE archives are not supported by Archive Manager. You must open then from the command line.
unace x <filename>.ace
- If you encounter error messages, the file you are trying to decompress is too new for version of unace in repositories. Go to the developer's site and download "Unace for Linux". Extract the unace binary from the archive and replace your current version of unace.
sudo mv /location/of/new/unace /usr/local/bin/unace
Rar (.rar)
- Rar is a non-free archive format created by Rarsoft. Version 3.0 is not supported by any free tools.
- The free program
unrar-free
, supports rar up to Version 2. - Package
unrar-free
is available in the Universe repository. - To add support for rar version 3, install the
unrar
package from the Multiverse repository.
Multi-volume .rar archives
- To extract the contents of a multi-volume .rar archive, extract the first file in the archive. Usually the extension will be .rar, .r00, or .r01.
GNU Tar (.tar)
- The .tar archive is an old archive format made for tapes. TAR archives consist of files that are sequentially added to a single file.
- TAR archives can be extracted using Archive Manager.
- TAR archives can also be extracted from the command line. See
man tar
for more information on command line usage.
GNU Tar GZ (.tar.gz .tgz)
- A Tar GZ archive is a gzip compressed .tar archive.
- Tar GZ archives can be extracted with Archive Manager.
- Tar GZ archives can also be extracted from the command line. See
man tar
for more information on command line usage.
GNU Tar bzip2 (.tar.bz2)
- Tar BZ2 archives are bzip2 compressed .tar archives.
Bzip2 compressed archives are smaller than gzip archives. The trade off is that bzip compression requires more processing power than gzip compression. |
- Tar BZ2 archives can be extracted with Archive Manager.
- Tar BZ2 archives can also be extracted from the command line. See
man tar
for more information on command line usage.
GNU Tar Compress (.tar.Z)
- A Tar Compress'd archive is a compress (.Z) compressed .tar archive.
- Tar Compress'd archives can be extracted with Archive Manager.
- Install the package
ncompress
from the Universe repository. After installation of the package, Archive manager will handle compress (.Z) archives seamlessly. - Tar Compress'd archives can also be extracted from the command line (after you have installed the
ncompress
package). Seeman tar
for more information on command line usage.
Zip (.zip)
- This is an older archive and compression format that originates with PKZip. It was developed by Phil Katz in 1989.
- ZIP files can be extracted with Archive Manager.
Command Line Usage
- Many of the above utilities can be used quickly and efficiently from the command line. This section will briefly cover common command line usage for these utilities. Replace <filename> with the name of your file.
- In most cases you can replace the filename with the complete path to the file.
Using a full path is useful when scripting. |
tar -czpf /home/me/somefile.tar.gz /path/to/files/to/be/archived
Extracting a tar.bz2 file
- Extract <filename>tar.bz2
tar jxvf <filename>.tar.bz2
- This will show you what it extracts, and in most cases will create a directory named <filename>.
- To extract a
tar.gz
, simply putz
in place ofj
in the command line. For more information please refer toman tar
.
Creating a tar.bz2 file
tar jcvf <filename>.tar.bz2 dir1 dir2 file1 file2 ...
- <filename>.tar.bz2 is the name of the tar file we wish to create.
dir#
andfile#
are the names of the directories or files we wish to include in the tar.bz2 archive. - To use gzip compression instead of bz2, simply put
z
in place ofj
in the command line.
For more information please refer to man tar
.
Rar
- Rar v3.0 archives require the use of
unrar
.
unrar-free
- Extract <filename>.rar
unrar-free <filename>.rar
- If extracting fails with a message like the following, try the non-free version.
Extracting file1.ext Failed Extracting file2.ext Failed 2 Failed
unrar-nonfree
- Extract <filename>.rar
unrar x <filename>.rar
zip and unzip
- To create a zip file containing
dir1
,dir2
, ... :
zip <filename>.zip dir1 dir1 ...
- To extract <filename>.zip:
unzip <filename>.zip