Child pages
  • Changing Defaults for Commands and Options - UNIX

Versions Compared

Key

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

...

Anchor
_Toc384453988
_Toc384453988
Anchor
_Toc384524361
_Toc384524361
Anchor
_Ref384706091
_Ref384706091
Anchor
_Toc28771151
_Toc28771151
Anchor
_Toc38702826
_Toc38702826
Anchor
_Ref221079367
_Ref221079367
Anchor
_Toc413923081
_Toc413923081
Anchor
ConfigView
ConfigView
Viewing Configuration Settings

 

To view the current default values for all commands and options, enter the configuration command by itself on the command line:

pkzipc -configuration

A list of current default settings displays:

...

For example, the add command can add all specified files to an archive (the all sub-option), or it can just add ones that are not in the archive already or are newer versions of files that are (the update sub-option). Initially, add has the default value of all, so a command line like the following adds all specified files indiscriminately:

pkzipc -add myfiles.zip *.*

To have this same command line add only new and newer files instead, you can use the configuration command to change the default behavior of add from all to update (see the section "Changing a Default Value," below):

pkzipc -configuration -add=update

...

For example, the initial configurable default for the compression filter path option, which saves or restores path information, is None. The option has several other sub-options that can be set as the default value instead, but no matter which sub-option is the default, path has the value of current (one of the sub-options) when used without a sub-option, as in this command line:

pkzipc -add -path myarchive.zip *.txt *.doc

...

For example, the following command line sets a default value for the overwrite option and suppresses display of the updated list of settings that the configuration command ordinarily prints to the screen:

pkzipc -config=silent -overwrite=never

Note that the silent sub-option of the configuration command is different from the silent option proper, which suppresses messages when adding or extracting.

See Appendix A this page for a list of PKZIP commands, options and sub-options, and information about which commands and options have configurable defaults.

...

Filter options listed in the display of default settings take separate defaults for compression and extraction. That is, you can make each filter behave differently when zipping and unzipping an archive. To specify a default for a filter option for one of these operations, include the related command (add or extract) on the command line. For example:

pkzipc -config -add -newer=1d

If you specify a default for a filter option without including the related command, as in the following example, PKZIP asks whether you want to specify the default for compression, extraction, or both:

pkzipc -config -newer=1d

Anchor
_Toc413923086
_Toc413923086
Changing Defaults for Compression Method

The Comp Method item in the screen of configuration settings shows the current default setting for compression method. To set a default compression method, specify the compression method that you want to make the default. For example, the following command makes BZIP2 the default compression method:

pkzipc -config -bzip2

The options in the table below set compression method:

...

For example, the following command sets the default compression method to Deflate and the default compression level to 9:

pkzipc -config -maximum

Anchor
_Toc38702829
_Toc38702829
Anchor
_Toc413923087
_Toc413923087
Using the Options Dialog to Change Defaults

...

Use the configuration command with the gui sub-option to display the graphical Options dialog:

pkzipc -config=gui

In the dialog, the Help button opens the online help for the Windows version of PKZIP or SecureZIP. There you can read how to set options in the dialog.

...

You can also use two hyphens without the config command to reset, or turn off, a configured default for an option just for the current command line. The example below turns off a configured default value (for instance, AES,256) for the cryptalgorithm option to do traditional encryption instead just for the current command line:

pkzipc -add --cryptalgorithm -passphrase wedding_plans.zip *.txt

...

To reset default values for all commands and options, use the default command. Type the following and press ENTER:

pkzipc -default

Anchor
_Toc413923091
_Toc413923091
Using an Alternate Configuration File

...

For example, the command line below creates or updates an alternate configuration file secure.xml in the root directory and specifies default values for the cryptalgorithm, sign, and certificate options:

pkzipc -config -altconfig=\secure.xml -cryptalg=aes,256 -sign=all -cert="John Public"

If you have PKZIP for Windows Desktop installed, you can use config=gui to configure defaults in the graphical Options dialogs. For example, the following command line opens the Options dialogs:

pkzipc -config=gui -altconfig=c:\secure.xml

...

You can use the altconfig option with any command. For example, the following command line loads the alternate configuration file secure.xml to use its settings with the add command. The settings cause PKZIP to use the specified certificate to sign the archive central directory and all files added to foo.zip and to encrypt the files using the strong encryption algorithm AES 256.

pkzipc -add -altconfig=c:\secure.xml -pass foo.zip *.doc

...

To view settings in an alternate configuration file, use the configuration command and specify the file with altconfig:

pkzipc -config -altconfig=c:\secure.xml

...