特殊:Badtitle/NS100:FileCompression:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第44行: | 第44行: | ||
==== Ace (.ace) ==== | ==== Ace (.ace) ==== | ||
ACE archives are relatively uncommon and are | ACE archives are relatively uncommon and are extracted using the 'unace' utility | ||
To add support for it, install <code><nowiki>unace</nowiki></code> from the universe repository (AddingRepositoriesHowto). | To add support for it, install <code><nowiki>unace</nowiki></code> from the universe repository (AddingRepositoriesHowto). | ||
第63行: | 第62行: | ||
Rar is a non-free archive format created by Rarsoft. There are several versions of rar and the newest version, 3.0, is not supported by any free tools. | Rar is a non-free archive format created by Rarsoft. There are several versions of rar and the newest version, 3.0, is not supported by any free tools. | ||
To add support for it, install the | To add support for it, install the <code><nowiki>unrar</nowiki></code> package from the multiverse repository (AddingRepositoriesHowto). | ||
< | |||
</nowiki></ | |||
===== 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 (look for one of these in this order). | |||
===== | |||
[[Anchor(tar)]] | [[Anchor(tar)]] | ||
第105行: | 第97行: | ||
Many of these utilities can be used on the command line, sometimes this is quicker or easier than using the [[basic Archive Manager]] | Many of these utilities can be used on the command line, sometimes this is quicker or easier than using the [[basic Archive Manager]] | ||
==== Extracting a tar.bz2 file ==== | |||
<pre><nowiki> | <pre><nowiki> | ||
tar jxvf file.tar.bz2 | tar jxvf file.tar.bz2 | ||
</nowiki></pre> | </nowiki></pre> | ||
This will show you what it extracts, and in most cases will be in a sub directory of <code><nowiki>file</nowiki></code> | This will show you what it extracts, and in most cases will be in a sub directory of <code><nowiki>file</nowiki></code>. | ||
To extract a <code><nowiki>tar.gz</nowiki></code>, simply put <code><nowiki>zxvf</nowiki></code> in place of <code><nowiki>jcxf</nowiki></code> in the command line. | |||
==== Creating a tar.bz2 file ==== | |||
<pre><nowiki> | <pre><nowiki> | ||
tar jcvf file.tar.bz2 dir1 dir2 ... | tar jcvf file.tar.bz2 dir1 dir2 ... | ||
</nowiki></pre> | </nowiki></pre> | ||
file.tar.bz2 is the name of the tar file we wish to create. <code><nowiki>dir1</nowiki></code> and <code><nowiki>dir2</nowiki></code> are the names of the directories and/or files we wish to include in the tar.bz2 archive. | |||
To use gzip compression instead of bz2, simply put <code><nowiki>zcvf</nowiki></code> in place of <code><nowiki>jcvf</nowiki></code> in the command line | |||
==== Rar ==== | |||
To extract a .rar file: | |||
<pre><nowiki> | |||
unrar x file.rar | |||
</nowiki></pre> | |||
==== zip and unzip ==== | |||
To create a zip file containing <code><nowiki>dir1</nowiki></code>, <code><nowiki>dir2</nowiki></code>, ...: | |||
<pre><nowiki> | <pre><nowiki> | ||
zip file.zip dir1 dir1 ... | |||
</nowiki></pre> | </nowiki></pre> | ||
To extract <code><nowiki>file.zip</nowiki></code>: | |||
<pre><nowiki> | <pre><nowiki> | ||
unzip file.zip | |||
</nowiki></pre> | </nowiki></pre> | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月22日 (四) 12:36的版本
文章出处: |
{{#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
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
Anchor(basic)
Many archives ( tar .tar,targz .tar.gz,zip .zip ) Can easily be opened simply by using Archive Manager.
To open these formats, click on them with the right mouse button, and choose "Extract here". like this:
Double-clicking on them will open the Archive Manager for other tasks.
Non-archive formats
These formats are not technically archives, but can be opened by Archive Manager:
Deb installer packages (.deb)
These 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. If not, open a terminal, go to the directory the .deb file is in by typing cd "DIRECTORYNAME"
, and type sudo dpkg -i DEBNAME.deb
. Warning: Installing programs from .debs can seriously damage your system.
CD Images (.iso)
These are images to be burned on to a cd. See UbuntuHelp:BurningIsoHowto
Java Archives (.jar)
These are java programs. See UbuntuHelp:Java
Firefox extensions (.xpi)
These are actually extensions for Mozilla Firefox. To install them, launch Firefox and choose Open File from the File menu. Choose the .xpi file and click ok. Firefox will then install the extension. Warning: Installing certain extensions may damage your Firefox profile
Archive formats
7zip (.7z)
7zip is a new type of free archive format.
Install the package p7zip
from the Universe repository (AddingRepositoriesHowto).
To open these files in basic Archive Manager You need to tell Ubuntu how to deal with these files. Right-click on them and choose Properties. The 4th tab is Open With. Click on it and choose the Add button. Select the program Archive Manager
.
After this, you can use these files normally from basic Archive manager
Ace (.ace)
ACE archives are relatively uncommon and are extracted using the 'unace' utility
To add support for it, install unace
from the universe repository (AddingRepositoriesHowto).
This cannot be used from basic Archive Manager so must be used on the command line. To extract .ace files, run the following command:
unace x file.ace
If you encounter problems (like file compressed with unknown method), the file you are trying to decompress is too new for version of unace in repositories. Go to their Download center and grab their Unace for linux. Inside the archive you will find newer version of unace (no compiling needed) which can be safely used instead the version from repositories. To install this file run the command:
sudo mv /location/of/downloaded/unace /usr/local/bin/unace
Rar (.rar)
Rar is a non-free archive format created by Rarsoft. There are several versions of rar and the newest version, 3.0, is not supported by any free tools.
To add support for it, install the unrar
package from the multiverse repository (AddingRepositoriesHowto).
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 (look for one of these in this order).
GNU Tar (.tar)
The tar archive is an old archive format made for tapes which consist of files added to a single file, one after the other.
These files can be extracted using the basic Archive Manager
GNU Tar GZ (.tar.gz .tgz)
This archive is a tar tar archive, which has then been zipped using 'gzip' which is an open source zip utility.
These files can be extracted using basic Archive Manager Anchor(tarbz2)
GNU Tar bzip2 (.tar.bz2)
This archive is a tar tar archive, which has then been zipped using 'bzip2' which is an open source zip utility which results in smaller file sizes than targz gzip however uses more processing power.
These files can be extracted using the basic Archive Manager Anchor(zip)
Zip (.zip)
This is an older archive (and compression) format that originates with PKZip developed by Phil Katz in 1989. It has been in use with DOS and windows for many years.
These files can be extracted using the basic Archive Manager
Command Line Usage
Many of these utilities can be used on the command line, sometimes this is quicker or easier than using the basic Archive Manager
Extracting a tar.bz2 file
tar jxvf file.tar.bz2
This will show you what it extracts, and in most cases will be in a sub directory of file
.
To extract a tar.gz
, simply put zxvf
in place of jcxf
in the command line.
Creating a tar.bz2 file
tar jcvf file.tar.bz2 dir1 dir2 ...
file.tar.bz2 is the name of the tar file we wish to create. dir1
and dir2
are the names of the directories and/or files we wish to include in the tar.bz2 archive.
To use gzip compression instead of bz2, simply put zcvf
in place of jcvf
in the command line
Rar
To extract a .rar file:
unrar x file.rar
zip and unzip
To create a zip file containing dir1
, dir2
, ...:
zip file.zip dir1 dir1 ...
To extract file.zip
:
unzip file.zip