Child pages
  • Adding Files to an Archive in UNIX

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added external links, more formatting

...

For example, the initial default value for the add command is all, which causes the command to add all files. See Chapter 8 this page for information on how to change default settings.

...

The command line below adds all .txt files in the current directory to myarchive.zip.

pkzipc -add myarchive.zip *.txt

...

You can also specify files from a different directory if you wish. For example, if you were in a parent directory to a directory called temp and you wanted to compress all the files in the temp directory, you could type the following:

pkzipc -add test.zip temp/*

The resulting test.zip file is stored in the current directory (the parent directory to the temp directory in our example).

...

For information on how to change default values for commands and options, see Chapter 8 this page.

Anchor
_Toc384453926
_Toc384453926
Anchor
_Toc384524294
_Toc384524294
Anchor
_Toc28771056
_Toc28771056
Anchor
_Toc38702731
_Toc38702731
Anchor
_Toc413922924
_Toc413922924
Adding New and Modified Files

...

In this example, a .ZIP file called test.zip is created in the current directory. All files in the current directory matching the file specification (*.doc) will be added or updated into the test.zip archive.

Anchor
_Toc384453927
_Toc384453927
Anchor
_Toc384524295
_Toc384524295
Anchor
_Toc28771057
_Toc28771057
Anchor
_Toc38702732
_Toc38702732
Anchor
_Toc413922925
_Toc413922925
Adding Only Files That Have Changed

...

If you only want to re-compress specific files, simply include those files in your command. For example, if you wanted to re-compress a file called resume.doc, you would type something like this:

...

In the above example, only resume.doc will be re-compressed into the test.zip file. This assumes that the version of resume.doc being added is newer than the version of resume.doc that already exists in the .ZIP file.

...

  • With the passphrase option, you specify a passphrase to use to decrypt the files. The passphrase option is available in both PKZIP and SecureZIP. It is used to do both strong and traditional ZIP passphrase-based encryption.
  • A passphrase is just a password. It is called a passphrase in the program to emphasize that PKZIP and SecureZIP support passwords that can contain spaces and other non-alphanumeric symbols.
  • With the recipient option, you specify a recipient list. A recipient list is a list of digital certificates that belong to people whom you want to allow to decrypt. PKZIP automatically decrypts the files for the owners of the certificates when the owners extract the files. You will learn more about digital certificates in Chapter 6 on this page.

Note: The recipient option is used only to do strong encryption and is available only in SecureZIP. Both PKZIP and SecureZIP can decrypt files encrypted with either kind of strong encryption (passphrase or recipient list).

...

pkzipc -add -passphrase=@secret.txt test.zip

The file (secret.txt in the example) should contain just the passphrase, on a line by itself.

...

Specify an Encryption Method

listcryptalgorithms, cryptalgorithm

When you use strong encryption (available only with SecureZIP for UNIX), you have a choice of encryption algorithms to use. To list the available algorithms, use the listcryptalgorithms command.

pkzipc -listcryptalgorithms

The following output from listcryptalgorithms lists all supported algorithms:

...

Note: The recipient option is available only with SecureZIP. You will learn more about digital certificates and recipient lists in Chapter 6.

recipient

Use the recipient option with the add command to strongly encrypt files and specify one or more digital certificates representing the people whom you want to allow to decrypt, also known as a recipient list.

...

By default, SecureZIP searches for certificates for listed recipients only in the system's local certificate stores. Use the ldap option (see page ) to cause SecureZIP to search a specified LDAP directory.

...

You can also specify OpenPGP keys to define a recipient list. You must first configure SecureZIP to enable OpenPGP on your system. See "Setting Up OpenPGP Keyrings." in Chapter 6.

When defining a recipient list, you can search on the name and email address as with X.509 certificates. You can also search on the OpenPGP KeyID (short or long) with this command:

...

Anchor
_Ref78101698
_Ref78101698
Anchor
_Toc413922930
_Toc413922930
Anchor
_Toc28771088
_Toc28771088
Anchor
_Toc38702759
_Toc38702759
Anchor
FNE
FNE
Encrypting File Names

cd

Note: The cd option uses strong encryption and is available only with SecureZIP.

...

Sub-Option

Effect

Example

encrypt

Encrypts file names and the archive's central directory.
This is the default sub-option, used if you enter -cd and do not explicitly specify a sub-option.

-cd=encrypt

normal

Does not encrypt file names; produces a normal ZIP file.
Use to override a configured default setting that would otherwise encrypt file names.

-cd=normal

 

You must use strong encryption when you use the cd option. You can use either strong passphrase encryption or a recipient list (or both), but you must use one of the strong encryption methods. You cannot encrypt file names using traditional, passphrase encryption.

...

Anchor
_Ref298160879
_Ref298160879
Anchor
_Toc413922931
_Toc413922931
Anchor
FIPS
FIPS
Encrypting Using Only FIPS-Approved Algorithms

fipsmode

"FIPS" is an abbreviation for "Federal Information Processing Standards," a set of standards for information processing in federal agencies. The standards are published by NIST (National Institute of Standards and Technology), a branch of the US government. The FIPS 140-2 standard defines security requirements for cryptographic modules and specifies the algorithms that federal agencies may use for cryptographic operations—encrypting, decrypting, signing, and authenticating digital signatures.

...

Anchor
_Ref56054003
_Ref56054003
Anchor
_Toc413922932
_Toc413922932
Anchor
ldap
ldap
Accessing Recipients in an LDAP Directory

ldap

The ldap option enables you to access X.509 digital certificates in a Lightweight Directory Access Protocol (LDAP) directory.

...

Use the keyserver option to locate OpenPGP keys. See Appendix A the Command Reference page for details on this option.

...

SecureZIP tests an LDAP connection immediately when you configure it. If the connection is bad, SecureZIP returns a warning to inform you of the problem before you try to use the connection to do encryption.
If you configure a default ldap option setting, it is applied implicitly whenever you use the recipient option to encrypt.

To remove configured settings for LDAP servers, use the --ldap option (two hyphens):

...

Some organizations use encryption tools based on the OpenPGP standard, rather than X.509. OpenPGP uses the same Public Key Infrastructure principles for exchanging encrypted files, but uses a decentralized "Web of Trust" method of authenticating signatures. See "Working with OpenPGP FilesFiles" in Chapter 6 for more information.

Before creating any OpenPGP files with SecureZIP, be sure to set up at least one keyring. See "Setting Up OpenPGP Keyrings" in Chapter 6 for details.

When you create an OpenPGP file containing more than one source file using -archivetype=pgp, as in the following example, SecureZIP creates a GNU TAR archive, copies the selected files to the archive, and then encrypts the TAR archive using OpenPGP. This command-line takes all text files in the current directory, creates a PGP archive called myfile.pgp, encrypts it with 128-bit AES and makes it available to a recipient, Test:

...

Find more information on using digital certificates in Chapter 6 on this page.

Anchor
_Toc413922936
_Toc413922936
Commands and Options for Signing Archives

certificate

Use the certificate option to specify a certificate or OpenPGP key to use to sign files. To specify a certificate or key, use one of the sub-options described in the following table.

...

For example, if the common name of the subject is John Q. Public, you can specify that certificate as follows:

pkzipc -add -certificate="John Q. Public" test.zip

The command uses the John Q. Public certificate to sign files. By default, both the files in the archive and the archive itself are signed. Use the sign option to change what is signed. Use the hash option to change the hash method used for signing.

...

Note that a certificate must contain an email address in order to be found by this method. Not all certificates embed an email address.

keyfile

You can reference a file that contains a certificate to use for signing with the #<filename> sub-option of certificate. If the private key is not included in the file with the certificate, use the keyfile option to specify the file that contains the private key. For example:

...

The keyfile option specifies a file containing the private key for the certificate specified by the certificate option. The option is most useful with SSL server certificates, which often have the private key and certificate in separate files.

keypassphrase

A private key in a file by itself or in a file that contains a certificate may be encrypted and require a passphrase for PKZIP to decrypt it to use. Use the keypassphrase option to supply the passphrase. For example:

...

The keypassphrase option specifies the passphrase used to decrypt private key information. This can be the passphrase used for your certificate store for a PKCS#12 file (specified with the certificate option), an OpenPGP private key, or a key file specified with the keyfile option.

Anchor
hash_option
hash_option
hash

You can use the hash option with the certificate option to specify the hash method/algorithm to use for signing. The option has the sub-options shown in the following table.

...

pkzipc -add -certificate="My Cert" -hash=sha256 test.zip *.*

Anchor
sign_option
sign_option
sign

You can use the sign option with the certificate option to specify whether to sign the central directory of the archive itself, the archived files, or both.

Signing the files enables a user to verify that the files are the same files you signed; signing the archive itself enables a user to verify that the contents of the archive have not changed—that, for example, no files have been added or removed. By default, SecureZIP signs both.

...

You can also use sign to add a digital signature to an existing archive. See "Using X.509 Digital Signatures" in Chapter 6 for more information.

listcertificates

Use the listcertificates command to list the certificates that are in a specified store on your system. Information for each certificate tells whether the certificate is Valid, Expired, Not Trusted, or Revoked (if known). If OpenPGP keys are enabled and available on the system, these will be displayed, including the Key ID value.

...

Anchor
_Toc413922942
_Toc413922942
Setting a Timeout for PKZIP to Wait

timeout

The timeout option sets a specified number of seconds for PKZIP to wait for another process to send or be ready to receive (more) data on a socket or device file. The timeout gives the other process time to handle data from PKZIP or to produce data for PKZIP to act on. By default, PKZIP waits 30 seconds. If the timeout period elapses without a response from the other process, PKZIP returns an error and halts processing.

...

Anchor
_Toc413922944
_Toc413922944
Adding Streamed Data  

stream

On UNIX, PKZIP ordinarily ignores pipe and socket files. The filetype option can be used to cause PKZIP to include definitions (name, permissions, times, and so on) to recreate pipes, sockets, or devices but does not capture their data. The stream option, used with filetype, gets the data from these sorts of files.

...

You can use the rename option to change the name by which the data is stored in the archive. For example, the following command line renames it stream_data.txt:

pkzipc -add -filetype=pipe -stream -rename=/mystream/stream_data.txt/ data.zip mystream

...

Without the stream option, the command line writes the data to an ordinary file named mystream. If a pipe of that name exists, the pipe is overwritten (See "Extracting Data to STDOUT or Special Files" in Chapter 4).

Anchor
_Toc413922946
_Toc413922946
Adding Streamed Data from STDIN

...

Note: Use the include option or place quotation marks around wildcard designations to avoid automatic wildcard expansion by the shell, which may interfere with your pattern search. See "Using Wildcards with PKZIP on UNIX." in Chapter 1.

Anchor
_Toc413922949
_Toc413922949
Storing Directory Path Information

...

For example, if a file you are compressing appears in the doc/temp directory, you can store the file within the .ZIP file as:

...

Sub-option

To

For example

current

Store the directory path relative to the current location.

pkzipc -add -path=current docs.zip docs/*

In this example, only directory information under the docs directory will be stored. Parent directory information will not be stored.

root, full

Store the full path, starting from the root directory down.

pkzipc -add -path=root docs.zip docs/*

In this example, the entire directory path, starting from "from root" directory will be stored.

specify

Stores path information for subdirectories under the specified directories

pkzipc -add -path=specify docs.zip temp/docs/*

Stores path information for subdirectories under temp\docs.

none

Turn off the path option. (Used to override configuration file).

pkzipc -add -path=none docs.zip /temp/docs/*

In this example, only the file names are stored.

Anchor
_Toc384453931
_Toc384453931
Anchor
_Toc384524300
_Toc384524300
Anchor
_Toc28771063
_Toc28771063
Anchor
_Toc38702738
_Toc38702738
Anchor
_Toc413922951
_Toc413922951
Storing and Recreating Directory Path Information

directories

The directories option works with both add and extract commands.

...

The following example uses the directories option with the add command to add any files called whatsnew.htm in the current directory or in any subdirectory of the current directory:

...

To tell PKZIP to start looking for matches from a subdirectory of the current directory, specify the path to the subdirectory. The following example gets all whatsnew.htm files in mysub/ or any of its subdirectories:

...

For information on extracting files saved with directory information, see the section "Retaining Directory Structure while Extracting." in Chapter 4.

Note: Use the include option or place quotation marks around wildcard designations to avoid automatic wildcard expansion by the shell, which may interfere with your pattern search. See "Using Wildcards with PKZIP on UNIX." in Chapter 1.

As with the path option, PKZIP provides several choices for saving directory path information. The following table lists the sub-options you can use with directories option:

Sub-option

To

For example

current

Store the directory path relative to the current location.

pkzipc -add -directories=current docs.zip docs/*

In this example, only directory information under the docs directory will be stored. Parent directory information will not be stored.

root or full

Store the full path, starting from the root directory down.

pkzipc -add -directories=root docs.zip docs/*

In this example, the entire directory path, starting from "from root" directory will be stored.

specify

Store path information for subdirectories under the specified directories

pkzipc -add -directories=specify docs.zip temp/docs/*

Stores path information for subdirectories under temp/docs.

none

Turn off the path option. (Used to override configuration file).

pkzipc -add -directories=none docs.zip /temp/docs/*

In this example, only the file names are stored.

...

Alternatively, you can use the options normal, store, speed, fast, and maximum to specify a desired balance between speed and degree of compression. See "Specifying a Compression Level by Name." later in this chapter.

With the dclimplode option, you set the compression level in a different way, namely, by specifying the dictionary type and size as sub-options.

Anchor
_Toc384453950
_Toc384453950
Anchor
_Toc384524319
_Toc384524319
Anchor
_Ref385048774
_Ref385048774
Anchor
_Ref385048799
_Ref385048799
Anchor
_Toc28771086
_Toc28771086
Anchor
_Toc38702764
_Toc38702764
Anchor
_Toc413922953
_Toc413922953
Anchor
CompLevel9
CompLevel9
Specifying a Compression Level from 0-9

level

The level option enables you to specify a level or degree of compression to use when creating or updating a ZIP archive with the Deflate64, BZIP2, or default Deflate compression methods. (See the deflate64 and bzip2 options to learn about using these compression methods.)

...

For information on changing default settings, see Chapter 8 this page.

Anchor
_Toc384453951
_Toc384453951
Anchor
_Toc384524320
_Toc384524320
Anchor
_Toc28771087
_Toc28771087
Anchor
_Toc38702765
_Toc38702765
Anchor
_Ref79208016
_Ref79208016
Anchor
_Toc413922954
_Toc413922954
Anchor
CompLevelName
CompLevelName
Specifying a Compression Level by Name

store, speed, fast, normal, maximum

As an alternative to setting numeric compression levels with level, you can use the options normal, store, speed, fast, and maximum.

...

Option

Description

Example

speed

Provides the fastest performance and the least compression: some files are compressed with the Deflate method, using level 1 compression; others* are stored (level 0) uncompressed.

pkzipc -add -speed test.zip *.doc

pkzipc -add -bzip2 -speed test.zip *.doc

fast

Provides the second fastest compression: some files are compressed with the Deflate method, using level 2 compression; others* are stored (level 0) uncompressed

pkzipc -add -fast test.zip *.doc

maximum

Provides the highest level of compression (level 9)

pkzipc -add -max test.zip *.doc

store

Provides zero compression: just stores files inside the archive (level 0)

pkzipc -add -store test.zip *.doc

normal
(Default)

Provides a middle balance of compression and speed (level 5)

pkzipc -add -norm test.zip *.doc

You would only need to use this option if you changed the default compression level. See Chapter 8 this page for information on setting defaults.

...

The following example adds the files listed in lst.txt to the archive test.zip:

pkzipc -add test.zip @lst.txt

You can also use a list file to specify files to exclude from an archive, based on some criteria, using the exclude option. The exclude option is discussed in Chapter 1 The Basics. For more information on the listchar option, see "Changing the List Character for List Files." in Chapter 9.

Note: The way you list files to extract is slightly different from the way you list files to add to an archive. See "Extracting Files with a List File" in Chapter 4 for more information.

Anchor
_Toc384453933
_Toc384453933
Anchor
_Toc384524302
_Toc384524302

...

Anchor
_Toc28771089
_Toc28771089
Anchor
_Toc38702760
_Toc38702760
Anchor
_Toc23648620
_Toc23648620
Anchor
_Toc413922958
_Toc413922958
Anchor
_Toc24263935
_Toc24263935
Anchor
_Toc25661957
_Toc25661957
Compressing Files with the BZIP2 Method

Anchor
_Toc28771090
_Toc28771090
bzip2

BZIP2 is an open-source compression algorithm that requires more memory and processing power than standard ZIP compression but provides greater compression. PKZIP can use BZIP2 compression to create either ZIP or BZIP2-format archives (.bz2 files). A BZIP2 archive, unlike a ZIP archive, can contain only a single file.

...

Anchor
_Toc413922959
_Toc413922959
Compressing Files with the LZMA Method

lzma

The LZMA compression algorithm often produces a higher compression ratio than BZIP2 but uses a lot of memory—as much as 16 MB—and takes more time than Deflate.

...

Anchor
_Toc38702761
_Toc38702761
Anchor
_Toc413922960
_Toc413922960
Compressing Files Compatible with the Data Compression Library

dclimplode

The dclimplode option enables you to use the same compression algorithms used by the PKWARE Data Compression Library. Files compressed with this method can be extracted by most versions of PKZIP 2.5x and later, though not by other .ZIP-compatible programs.

...

Anchor
_Toc413922961
_Toc413922961
Compressing Files with the PPMd Method

ppmd

The ppmd option achieves especially good compression for natural language text but can use a lot of memory (~16 MB) and takes more time than Deflate.

...

Anchor
_Ref38173895
_Ref38173895
Anchor
_Ref38173960
_Ref38173960
Anchor
_Toc38702762
_Toc38702762
Anchor
_Toc413922962
_Toc413922962
Anchor
CompType
CompType
Compressing Files to a Specified Type of Archive

archivetype

The archivetype option explicitly tells PKZIP the type of archive to create or extract. Use the option when PKZIP cannot figure out the correct archive type from the archive's file name. For some examples, see "Writing an Archive to STDOUT."

...

Anchor
_Toc28771103
_Toc28771103
Anchor
_Toc38702777
_Toc38702777
Anchor
_Toc413922963
_Toc413922963
Anchor
_Toc28771078
_Toc28771078
Anchor
_Toc38702753
_Toc38702753
Compressing Files to Removable Media

span

With PKZIP, you can save your .ZIP or self-extracting archive to removable media when you create it (instead of saving it on your hard disk drive). You can also create a split archive that is saved as multiple files on your hard disk. You can also have PKZIP format or wipe your removable media before writing to it.

...

Anchor
_Toc413922966
_Toc413922966
Preserving International Characters in File Names

utf8

The utf8 option enables UTF-8 characters in file names and file comments to be correctly displayed when an archive's contents are viewed or extracted in compatible non-UTF-8 locales.

...

Anchor
_Toc413922967
_Toc413922967
Creating Multiple, Respective Archives

archiveeach

With the archiveeach option, you can create a separate archive for each of multiple files specified in a single command line.

...

With archiveeach, you do not specify names for new archives. PKZIP names each new archive after the file it contains, with an archive-type file name extension (ZIP by default) appended to the end. For example, a ZIP archive created for file mydata.xls is named mydata.xls.zip. An archive created for file mydata.zip is named mydata.zip.zip.

If an archive with the same name already exists in the target location, PKZIP appends a number to the archived file name before appending the .zip (or other file name extension). For example: mydata.xls2.zip. Use archiveeach with overwrite to specify different behavior, such as

...

You can use the substitution option to have PKZIP add a timestamp to the name of a new destination directory created for the archives. See "Inserting a Timestamp in the Archive File Name." in Chapter 7.

Anchor
_Toc413922968
_Toc413922968
Storing File Information

...

Anchor
_Toc28771074
_Toc28771074
Anchor
_Toc38702749
_Toc38702749
Anchor
_Toc413922970
_Toc413922970
Compressing Files Based on File Type

filetype

Include or exclude files by type when adding or extracting files with the filetype option . Specify the type of file in the sub-option. Precede the sub-option with a hyphen to exclude files of that type, or use the sub-option without a hyphen to include such files. For example,

...

PKZIP allows you to follow the UNIX links of a file when compressing files by using the links option.

...

Anchor
_Toc28771076
_Toc28771076
Anchor
_Toc38702751
_Toc38702751
Anchor
_Toc413922972
_Toc413922972
Extended Attribute Storage

noextended

When PKZIP adds files to an archive, PKZIP stores the standard FAT file system attributes (Read-Only, Archive, System, Hidden, Directory). By default, various extended attributes are stored as well. These include NTFS times on Windows and userid, groupid, and UNIX times on UNIX. The extended attribute timestamps are more accurate than the DOS modification time, but you can slightly reduce the size of an archive by omitting this extended attribute information.

...

Note: The noextended option does not affect storage of the offline, temporary, and system attributes on DOS systems, or storage of filetype attributes on UNIX systems.

Extended Attributes and the OS

...

Anchor
_Toc28771077
_Toc28771077
Anchor
_Toc38702752
_Toc38702752
Extended Attributes and 204g Compatibility

204

By default, PKZIP does not enable PKZIP for DOS 2.04g compatibility. When 204g compatibility is enabled, extended attribute data is stored in both the Local header and Central header records. This will result in a slightly larger .ZIP file size, but improves the chance that extended attribute information can be recovered if the .ZIP file should become damaged. It also ensures the extended attribute information is always retained if the file is generated with a version of PKZIP other than 2.04g. This option is ignored when extracting. The 204 option also limits the number of files that can be added to a .ZIP archive to 16,383. To enable 204g compatibility, use the 204 option as in the following example:

...

Anchor
_Toc384453944
_Toc384453944
Anchor
_Toc384524313
_Toc384524313
Anchor
_Toc28771080
_Toc28771080
Anchor
_Toc38702755
_Toc38702755
Anchor
_Toc413922974
_Toc413922974
Including a Text Comment

comment

With PKZIP, you can include a comment for the individual files within a .ZIP file. There are several options for adding comments to your .ZIP files. To include a comment, use the comment option alone or with the add command. When you run the command, PKZIP prompts you to enter the comment.

...

Anchor
_Toc384453946
_Toc384453946
Anchor
_Toc384524315
_Toc384524315
Anchor
_Toc28771082
_Toc28771082
Anchor
_Toc38702757
_Toc38702757
Anchor
_Toc413922975
_Toc413922975
Including a Header Comment

header

With PKZIP, you can include a general comment for a .ZIP file. This is called a "header" comment because it appears in the header portion of a .ZIP file. This differs from the comment option in that the "header" comment applies to the entire .ZIP file, not to individual files within the .ZIP file.

...

If you include the header option alone, without a value, PKZIP prompts you for text to use, as follows:

Zip Header ?

Type your header comment and press ENTER.

...

Note: You can also use header to add a comment to OpenPGP files wrapped in ASCII Armor (see "Encoding an Archive to another Type" in Chapter 7). The comment is displayed when viewing, testing or extracting the archive.

Anchor
_Toc384453948
_Toc384453948
Anchor
_Toc384524317
_Toc384524317
Anchor
_Toc28771084
_Toc28771084
Anchor
_Toc38702758
_Toc38702758
Anchor
_Toc413922976
_Toc413922976
Specifying the Date of a .ZIP File

archivedate

When you create an archive file, PKZIP gives it the current date by default. You can specify a different date for the file by using the archivedate option with the add command.

...

Anchor
_Toc413922978
_Toc413922978
Removing File Attributes 

mask

The mask option specifies a permissions mask for files to be added or extracted. The mask specifies permissions which should not be archived or restored on extraction.

...

Anchor
_Toc38702766
_Toc38702766
Anchor
_Toc413922979
_Toc413922979
Sorting Files Within a .ZIP File

sort

With PKZIP, you can sort the files in an archive in several ways. If you do not change the sort order, the files are automatically sorted in the order in which they were compressed into the archive. This is called the "natural" order.

...

Sub-Option

To sort by

For example

date

File date.

pkzipc -add -sort=date temp.zip

size

Original uncompressed size of the file ("length" in display).

pkzipc -add -sort=size temp.zip

extension

File extension.

pkzipc -add -sort=ext temp.zip

name

Sorts files and folders by name in a single series. (Contrast with -sort=none.)

pkzipc -add -sort=name temp.zip

none

Groups folders first, sorted by name, and then groups files, sorted by name. (The default.)

pkzipc -view -sort=none temp.zip

natural

Preserves the order in which files were added to an archive.

pkzipc -view -sort=natural temp.zip

ratio

Ratio of uncompressed size to compressed size.

pkzipc -view -sort=ratio temp.zip

Note: The ratio sub-option will not work with the add command.

crc

CRC (Cyclic Redundancy Check) number.

pkzipc -view -sort=crc temp.zip

Note: The crc sub-option will not work with the add command.

comment

File comment.

pkzipc -view -sort=comment temp.zip

Note: The comment sub-option will not work with the add command.

...

Anchor
_Toc384453953
_Toc384453953
Anchor
_Toc384524322
_Toc384524322
Anchor
_Toc28771093
_Toc28771093
Anchor
_Toc38702767
_Toc38702767
Anchor
_Toc413922980
_Toc413922980
Moving Files to a .ZIP File

move

Normally, when you compress files, you end up with two copies of each file: the original file and the compressed file. With PKZIP, you can choose to remove the original file "after" you compress it into the .ZIP file.

...

Anchor
_Toc384453954
_Toc384453954
Anchor
_Toc384524323
_Toc384524323
Anchor
_Toc28771094
_Toc28771094
Anchor
_Toc38702768
_Toc38702768
Anchor
_Ref78100551
_Ref78100551
Anchor
_Toc413922982
_Toc413922982
Anchor
SFX
SFX
Working with Self-Extracting (PKSFX) Archives

sfx

If you have the PKZIP Self-Extractor add-on, you can use PKZIP to create PKSFX archives. A PKSFX archive is self-extracting: it has an .exe file name extension (instead of .zip, for instance), and it can be extracted just by executing it, even by someone who does not have PKZIP or another ZIP utility. (PKSFX archives are also called self-extractors or SFX files, for short.)

...

To create a self-extracting archive, use the sfx option with the add command. For example, the following line creates a native command line self-extractor mysfx.exe:

pkzipc -add -sfx mysfx *.doc

...

Option

Works only with GUI Self-Extractors

SFXDestination

X

SFXDirectories

X

SFXLogfile

 

SFXOverwrite

X

SFXUIType

X

RunAfter

 

SFXDestination

The SFXDestination option specifies a default target folder for extracted files. For example:

...

The SFXDestination option works only with a GUI self-extractor.

SFXDirectories

The SFXDirectories option causes the self-extractor to restore saved directory paths on extraction. To recurse subdirectories and save path information (relative to the current directory) when you add files to a self-extractor, use the directories option.

...

The SFXDirectories option works only with a GUI self-extractor.

SFXLogfile

The SFXLogfile option creates an ASCII text SFX error log named pkerrlog.txt in the destination directory on extraction.

pkzipc -add -sfx -sfxlogfile test.exe *.doc

SFXOverwrite

The SFXOverwrite option specifies when the self-extractor overwrites files that have the same name as a file being extracted. The option has the sub-options listed in the table below.

...

The SFXOverwrite option works only with a GUI self-extractor.

SFXUIType

The SFXUIType option specifies the type of graphical interface that the self-extractor presents to the user. This option only affects GUI self-extractors. (Command line self-extractors do not present a GUI.) The option has the sub-options listed in the table below.

...