Changing Defaults for Commands and Options - UNIX
Use the configuration command to view current default settings for commands and options. You can also use this command to change default values. Another command—default—restores default settings for all commands and options to their original values.
With the altconfig option, you can create and apply alternate configuration profiles for special purposes.
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:
CRL = Disabled : Static | |
204 = Disabled | Add = Add All Files |
ArchiveDate = None | CD = Normal |
Comment = None | Comp Method = Deflate |
Comp Method = Deflate | Encode = Disabled, UUE |
Encode (OpenPGP) = Disabled | Extract = Extract All Files |
FIPSMode = Disabled | Hash = SHA-1 |
Hash (OpenPGP) = SHA-1 | KeyPassphrase = Disabled |
Level = Normal | ListChar = @ |
Locale = Enabled | Lowercase = Disabled |
More = Disabled | MoveArchive = Disabled |
NoArchiveExtension = Disabled | NoExtended = Disabled |
NoFix = Disabled | OpenFile = Never (skip) |
OptionChar = - | Passphrase = Disabled |
Priority = Normal | Recurse = Disabled |
Shortname = None | Shred = None |
Sort = None | Span = None, Auto-Detect |
Substitution = Disabled | Test = All Files |
Times = All | UTF8 = Enabled |
UsePGPName = Disabled | View = Normal |
ZoneIdentifier = Disabled |
ASCII = Disabled
Authenticate = Disabled
AVArgs = Disabled
AVScan = Disabled
Binary = Disabled
Certificate =
Certificate (OpenPGP) =
CryptAlgorithm = Traditional
CryptAlgorithm (OpenPGP) = AES (256-bit)
CryptOptions = Smartcard, Win2000, FastAES
Embedded = Disabled
Error = None
FTP = Disabled
Header = Disabled
LDAP = Disabled
Log = stdout
LogAudit = Disabled
LogError = stderr
LogOptions = None
MailBCC = Disabled
MailBody = Disabled
MailCC = Disabled
MailFrom = Disabled
MailOptions = None
MailReplyTo = Disabled
MailServer = Disabled
MailSubject = Disabled
MailTo = Disabled
GroupFile = Default
Recipient = Disabled
Recipient (OpenPGP) = Disabled
Sign = Disabled, Central directory and individual files
Silent = Copying
SnmpTrapHost = Disabled
Strict = Disabled : KeyUsage, TimeValid, TimeNesting
TS = Disabled
Temp = Disabled
VerifySigner = Disabled
VerifySigner (OpenPGP) = Disabled
Warning = None
PKSFX Options
Create Folders = Disabled Display Messages = Disabled
Overwrite = Prompt Sfx = WIN32_X86_C1230
SfxLogfile = Disabled Type = EasySFX
Destination =
Title Bar = Disabled
RunAfter = Disabled
Program Group = Disabled
Extensions = Disabled
Compression Options
After = Disabled
AltStream = None
Attributes = Read-Only, Archive
Before = Disabled
Exclude = Disabled
Include = Disabled
Larger = Disabled, 0
Mask = None
Newer = Disabled
Older = Disabled
Overwrite = Always Overwrite
Overwrite (ArchiveEach) = Increment
Path = No Path Information
Smaller = Disabled, 18,446,744,073,709,551,615
Translate = None - No Conversion
Extraction Options
After = Disabled
AltStream = Native
Attributes = Read-Only, Hidden, System, Archive
Before = Disabled
Exclude = Disabled
Include = Disabled
Larger = Disabled, 0
Mask = None
Newer = Disabled
Older = Disabled
Overwrite = Prompt
Path = Full Path
Smaller = Disabled, 18,446,744,073,709,551,615
Translate = None - No Conversion
In the display, the command/option is to the left of the equal sign, and the default setting is to the right. An option listed as Disabled is disabled by default. An option listed as None has a None sub-option that is its default value. A command or option that has any other value has that value as its default. In most of these cases, the value is a predefined sub-option.
The PKSFX options appear only if you have PKZIP Enterprise or SecureZIP.
How Default Settings Work
Configurable options that have a default value are applied, with their default value, even when they are not explicitly entered on the command line. If an option has a default value of None, PKZIP applies the option with the value of their None sub-option. Disabled options are not applied.
For example, Comment = None indicates that, by default, PKZIP does not prompt for comments to attach to files in an archive. If you want PKZIP to always prompt for comments on files, you can configure the default to a different value—for example, Comment = All. All is another sub-option of comment. With this default, PKZIP will routinely prompt even when the comment option is not used in the command line.
For a command, the default setting determines what the command does when the command is listed on the command line without an explicit sub-option.
A command must explicitly appear in the command line to be used. This is a difference between commands and options. A default value for a command determines what the command does when it is used by itself, without any specified sub-option.
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
Some options also have a value—distinct from any configurable default value—that is used automatically if the option is used on the command line without an explicit sub-option. This value overrides any configured default value.
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
Appendix A lists the defaults and override values for all commands and options.
Filter Options
At the bottom of the listing of defaults are two sets of filter options, one for compression and one for extraction. These are called filter options because they filter out files that do not meet their criteria. Only files that are not filtered out are selected. For example, the after option filters out all files whose date falls before the date specified with the option.
Each of the filter options takes a different default value for compression and for extraction.
Changing a Default Value
To change a default setting in the configuration file, use the configuration command. You can abbreviate this command to: config.
- To specify a value (sub-option) to use as the default value for a command/option, type pkzipc -config and the name of the command/option followed by an equal sign and the sub-option value you want to set as the default.
- For example, to change the default for the add command to update (instead of the original default, all), type the following:
pkzipc -config -add=update
- To turn on and use by default an option that has either no sub-options or a sub-option that is used by default, type pkzipc -config and the name of the option.
- To turn on the silent option and use its default sub-option:
pkzipc -config -silent
After you use the configuration command to change a default setting, an updated list of settings displays. You can suppress this list so that it is not displayed. To do so, use the configuration command with its silent sub-option.
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
The silent sub-option of the configuration command is different from the silent option proper, which suppresses messages when adding or extracting.
See this page for a list of PKZIP commands, options and sub-options, and information about which commands and options have configurable defaults.
Changing Defaults for Filter Options
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
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:
Compression Method Options | Description |
deflate64 | Sets the compression method to Deflate64 |
bzip2 | Sets the compression method to BZIP2 |
dclimplode | Sets the compression method to DCL Implode |
lzma | Sets the compression method to LZMA |
ppmd | Sets the compression method to PPMd |
store | Sets the compression method to Store (that is, no compression) |
The options in the next table set both compression method and level:
Option | Description |
speed | Sets the compression method to Deflate—the initial PKZIP default method—and the level of compression to 1 (the lowest) |
fast | Sets the compression method to Deflate and the level of compression to 2 |
normal | Sets the compression method to Deflate and the level of compression to 5. Normal is the initial default setting for compression method and level for PKZIP. |
maximum | Sets the compression method to Deflate and the level of compression to 9 |
level=0 | When set to 0, the level option sets the compression method to Store (no compression) |
For example, the following command sets the default compression method to Deflate and the default compression level to 9:
pkzipc -config -maximum
Using the Options Dialog to Change Defaults
If you have PKZIP for Windows Desktop installed, you can use the graphical Options dialogs instead of the command line 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.
Settings that you make in the Options dialog when you use the gui sub-option apply only to the command line version of the product, not to the Windows version. Similarly, if you open the Options dialog from the Windows version, options that you set in the dialog apply only to the Windows version.
If you use the gui sub-option without having PKZIP for Windows installed, the sub-option is ignored, and the command works as if you had entered it with no sub-option.
Resetting to Original Defaults
Command or option default values that you have changed can be reset back to their original values. You can reset changed defaults either for individual commands and options that you specify, or wholesale, for all.
Resetting Individual Defaults
To reset an individual command or option to its original default value in the configuration file, use the config command and put two hyphens in front of the command or option that you want to reset.
For example, to reset the add value back to its original default without resetting any other default values that you may have modified, type the following and press ENTER:
pkzipc -config --add
Notice that there are two hyphens in front of the add command. The command changes the update value we set in a previous example back to all.
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
Resetting All Defaults
To reset default values for all commands and options, use the default command. Type the following and press ENTER:
pkzipc -default
Using an Alternate Configuration File
altconfig
You can create alternate configuration profiles to use for special purposes. The altconfig option creates and loads alternate configuration profiles. With an alternate configuration profile, you can temporarily change multiple default command or option settings in a single pass just by loading the configuration profile that defines them.
Creating an Alternate Configuration File
To create an alternate configuration profile, use the altconfig option with the configuration command. This creates a copy of the current main configuration file with the file name and at the location specified by the altconfig option and updates default settings in the copy with any new settings specified in the command line. If an alternate configuration file of that name already exists at the specified location, the file is updated with the new default settings from the command line. Other settings in the file are left unchanged.
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
If secure.xml
exists, PKZIP displays its settings in the graphical Options dialogs. If the file does not already exist, PKZIP displays the settings of your main configuration file. In either case, saving settings from the Options dialog saves to secure.xml
.
Using an Alternate Configuration File
To use the settings in an alternate configuration file, use the altconfig option to specify the file in a command line with which you want to use the alternate settings.
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
Loading the settings from the alternate configuration file saves the trouble of specifying them all on the command line and does not require changing the main configuration file.
To view settings in an alternate configuration file, use the configuration command and specify the file with altconfig:
pkzipc -config -altconfig=c:\secure.xml
An alternate configuration file must already exist for you to use it in a command line with the add command or any other command besides configuration. The only time you can use the altconfig option to specify an alternate configuration file that does not already exist is when you use the option with the configuration command to create an alternate configuration file.