Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


8.4.17 gzip command (compresses files or decompresses compressed files)

Syntax

[Only for Windows]
gzip [-1|-2|-3|-4|-5|-6|-7|-8|-9] [-c] [-d] [-f] [-k] [-l] [-N] [-n] [-q]
     [-r] [-t] [-v] [-o output-path-name] [-S suffix] [target-path-name ...]
[Only for UNIX]
gzip [-1|-2|-3|-4|-5|-6|-7|-8|-9] [-a] [-c] [-d] [-f] [-k] [-l] [-N] [-n] [-q]
     [-r] [-t] [-v] [-o output-path-name] [-S suffix] [target-path-name ...]

Description

This command compresses files or decompresses compressed files.

This command enables you to perform the following operations:

Operation type

Description

Compress

Compresses a file (hereafter, this operation is called a compression operation).

If the -d, -l, and -t options are omitted, a compression operation is performed.

The format of the compressed file is gzip (hereafter, files compressed in gzip format are called "compressed files").

Compresses the file data by using the DEFLATE compression method# (hereafter, compressed file data is called "compressed data").

The compressed data is stored in the compressed file that was created by the compression operation.

In a compression operation, the compressed file is created with the extension .gz appended to the name of the file to be compressed.

In a compression operation, the file to be compressed is deleted after the compressed file is created.

Decompress

Decompresses a compressed file when the -d option is specified (hereafter, this operation is called a decompression operation).

Only files compressed in gzip format can be decompressed. The system assumes files with .gz or .tgz extensions are compressed files. Files that are not compressed in gzip format or those without .gz or .tgz extensions cannot be decompressed.

In a decompression operation, the decompressed file is created under a name whose character string is generated as follows:

  • Character string of the compressed file name with its extension .gz removed.

  • Character string of the compressed file name with its extension changed from .tgz to .tar.

In a decompression operation, the compressed file is deleted after the decompressed file is created.

Display

Displays the information about the compressed file when the -l option is specified (hereafter, this operation is called a display operation). For details about the displayed information of compressed files, see the description of the -l and -v options, as well as Displaying the compressed file information.

Verify

Specifying the -t option verifies the integrity of the compressed data stored in the compressed file without decompressing the compressed file (hereafter, this operation is called a verification operation).

#

Compression method used when the file is compressed in gzip format.

In compression operations and decompression operations, if you do not want to delete the files to be compressed or the compressed files, perform one of the following operations:

  1. Output the compression result and the decompression result to the standard output.

    The following operation outputs the compressed or decompressed file data to the standard output without deleting the files. As required, redirect the output results to files or send them to other programs by using a pipe.

    • Specify the -c option.

    • Enter the files to be compressed or the compressed file from the standard input.

  2. Specify the -k option.

    If this command is executed by specifying the -k option, the system behaves as follows:

    [For compression operations]

    Files to be compressed are not deleted even after the compressed file is created.

    [For decompression operations]

    Compressed files are not deleted even after the decompressed files are created.

In compression operations and decompression operations, if an existing file has the same name as the compressed file or decompressed file to be created, the system asks whether to overwrite the file. If the response character from the standard input begins with y or Y, the system deletes the existing file, and then creates the compressed file or decompressed file. If the response character does not begin with y or Y, or when the standard input cannot be used, processing on the target files stops. If you want to permit overwriting of files without prompting, specify the -f option.

Note that directories cannot be compressed in compression operations. If you want to compress files while retaining their directory configuration, create an archive by using the tar command, and then compress that archived file. In addition, by using the -z option of the tar command, you can simultaneously create and compress the archive file. For details about the tar command, see 8.4.34 tar command (stores the target path name in the archive and extracts/displays the target path name).

Verification of the integrity of the compressed data, which is performed in the verification operation, is also performed in the decompression operation. Note that for values (information such as the compression method) other than the compressed data of the compressed file, integrity verification is performed in all operations.

You can use the options of the gzip command without specifying them in the command arguments, by specifying the options in the environment variable GZIP. For details about the environment variable GZIP, see 2.5 Specifying environment variables.

Arguments

Specifying operation options

Specify the operation to be executed.

If this command is executed without specifying the following options, the file will be compressed (compression operation):

-d

--decompress

--uncompress

Decompresses the compressed file (decompression operation).

If this option is specified at the same time as the -l or -t option, the specification is ignored.

-l

--list

Displays information about the compressed file (display operation).

Displays information such as the file size before compression and the compression ratio.

If the -v option is specified at the same time, detailed information about the compressed file is also displayed.

For details about the displayed content, see Displaying compressed file information.

Note that if the displayed file size before compression is 4 GB or greater, the value might not be displayed correctly. If you want to display the correct file size, specify the -t option at the same time. However, if the -t option is specified at the same time, displaying the file size might take some time.

-t

--test

Verifies the integrity of the compressed data stored in the compressed file without decompressing the compressed file (verification operation).

If this option is specified at the same time as the -l option, both the integrity verification of the compressed data and the display of information about the compressed file are performed.

Specifying the compression level

-compression-level

--fast

--best

When performing compression, use levels to specify the compression speed and the compression ratio.

Specify the compression level from a range of 1 to 9. The meanings of the values are as follows:

  • Compression speed

    1 is the fastest, and 9 is the slowest.

    As the value gets larger, the compression speed gets slower.

  • Compression ratio

    1 is the lowest, and 9 is the highest.

    As the value gets larger, the compression ratio gets higher.

If this option is not specified, the file is compressed using compression level 6.

The --fast option compresses the file using the same compression level as -1.

The --best option compresses the file using the same compression level as -9.

If you specify this option multiple times, the last option specified is valid.

If this option is specified at the same time as the -d, -l, or -t option, the specification is ignored.

Specifying behavior for saving and recovering file information

Specify behavior for saving and recovering file information.

If the -N and -n options are specified at the same time, only the last specified option is valid. If the -N or -n option is specified at the same time as the -t option, the specification is ignored.

For details about using the most recent modification date and time in compression operations and decompression operations, see Handling of the most recent access date and time or the most recent modification date and time for a file. For details about the handling of file names and the most recent modification date and time in display operations, see Displaying compressed file information.

-N

--name
[For compression operations]

Stores the file name and the most recent modification date and time of the file to be compressed, in the compressed file. File names to be stored in the compressed file are extracted from the path name. Note that when a file to be compressed is entered from the standard input, the execution date and time of the command is stored in the most recent modification date and time in the compressed file. However, the file name is not stored in the compressed file.

[For decompression operations]

Names the file created at decompression using the file name stored in the compressed file. In addition, sets the most recent modification date and time stored in the compressed file, for the created file. If the file name and the most recent modification date and time are not stored in the compressed file, the system behaves the same as when the -n option is specified.

[For display operations]

In the displayed compressed file information, displays the file name and the most recent modification date and time stored in the compressed file.

In compression operations, this option is the default behavior.

-n

--no-name
[For compression operations]

Does not store the file name or the most recent modification date and time of the file to be compressed, in the compressed file.

[For decompression operations]

Names the file created at decompression using the file name from the compressed file, with the compressed file extension removed. In addition, sets the most recent modification date and time of the compressed file to the created file.

[For display operations]

In the displayed compressed file information, displays the file name as the compressed file name with its extension removed, and the most recent modification date and time of the compressed file.

For decompression operations and display operations, this option is the default behavior.

Specifying input and output

-c

--stdout

--to-stdout
[For compression operations]

Outputs compressed file data to the standard output.

An error occurs if the standard output is linked with the terminal when the command is executed.

If multiple files are compressed by specifying this option, compression and output to the standard output is repeated for each file. This behavior is the same as when multiple compressed files are concatenated by using commands such as the cat command (to create a single compressed file). For notes on compressed files created by this operation, see Notes.

[For decompression operations]

Outputs the result of decompressing the compressed data to the standard output.

If this option is specified at the same time as the -l or -t option, the specification is ignored.

-k

--keep
[For compression operations]

The original files to be compressed are not deleted even after the compressed file is created.

[For decompression operations]

The compressed file is not deleted even after the decompressed file is created.

If this option is specified at the same time as the -l, -t, or -c option, the specification is ignored.

-r

--recursive

If the path specified in the target-path-name is a directory, searches recursively for files in the directory and its subdirectories.

[For compression operations]

Searches for files in the directory and its subdirectories that are not compressed.

[For decompression operations, display operations, and verification operations]

Searches for compressed files in the directory and its subdirectories.

In Windows, when the -r option is specified, directory delimiters at the end of the path name are ignored, even when you specify a symbolic link to a directory.

The file extension determines whether files found while searching are handled as compressed files. For details about the file extensions of files that are handled as compressed files, see Handling of the extensions of compressed files.

Symbolic links to directories are followed to their destination based on the operation type and the specified options. For details about behavior when a symbolic link to a directory is specified, see Handling of link files.

-ooutput-path-name

--output=output-path-name
[For compression operations]

Creates a compressed file based on the specified path name.

In addition, in compression operations, the files to be compressed are deleted.

[For decompression operations]

Creates the files to be decompressed based on the specified path name. In addition, in a decompression operation, the compressed file is deleted. If the -N option is specified at the same time as the decompression operation, the most recent modification date and time stored in the compressed file is used. The file name is based on the output-path-name.

This option ends in an error if one of the following is specified at the same time.

  • When the -c, -t, -l, or -r option is specified.

  • When more than one file to be compressed or compressed file is specified.

  • Enter the files to be compressed, or the compressed file, from the standard input.

Target-path-name
[For compression operations]

Specify the path name for the file to be compressed.

[For decompression operations, display operations, and verification operations]

Specify the path name for the compressed file.

For details about specifying compressed files in compression operations, or specifying files other than compressed files in decompression operations, display operations, and verification operations, see Handling of the extensions of compressed files.

More than one target-path-name can be specified.

If the target-path-name is not specified, or when - is specified for the target-path-name, enter the file data to be compressed or the compressed data from the standard input. For compression operations and decompression operations, when the file data to be compressed or the compressed data is input from the standard input, the compressed file data or the result of decompressing the compressed data is output to the standard output. Note that in a compression operation, an error occurs if the standard output is linked to the terminal. In a decompression operation, an error occurs if the standard input is linked to the terminal.

The file types that can be specified for the target-path-name are as follows:

  • For compression operations and decompression operations, only regular files can be specified. In addition, whether link files can be specified depends on the specified options. For details about behavior when link files are specified, see Handling of link files.

  • For display operations and verification operations, regular files and link files can be specified.

  • A directory can be specified for the -r option. Whether a symbolic link to a directory can be specified depends on the operation type and the specified options. For details about behavior when a symbolic link to a directory is specified, see Handling of link files.

An error occurs if the specified target-path-name is a file type other than the file types that can be operated.

Other specifications

-a

--ascii
[Only for UNIX]

This option is for compatibility with the gzip command provided by the OS.

This option is not valid even if specified. However, the message gzip: Option -a is ignored on this system is output to the standard error output.

-f

--force

Permits the following operations:

[For compression operations]

  • Follows the link destination in a link file. For details about link files, see Handling of link files.

  • If an existing file has the same name as the compressed file to be created, the system overwrites the file without prompting the user.

  • When the -c option is specified or when the file data to be compressed is entered from the standard input, output of the compressed file data begins even if the standard output is linked to the terminal.

[For decompression operations]

  • Follows the link destination in a link file. For details about link files, see Handling of link files.

  • If an existing file has the same name as the decompressed file to be created, the system overwrites the file without prompting the user.

  • When the file data to be operated is entered from the standard input, the input begins even if the standard input is linked to the terminal.

-S suffix

--suffix= suffix

Uses the specified suffix (any character string) as the extension of the compressed file.

[For compression operations]

Creates a compressed file using a specified suffix instead of an extension .gz.

[For decompression operations]

The system assumes that a file that has the extension .gz or .tgz, and has a suffix attached, is a compressed file.

The specifiable length of the suffix ranges from 1 to 30 bytes. Multibyte characters cannot be used for a suffix. For details about behavior when a suffix is specified, see Handling of the extensions of compressed files.

-q

--quiet

Suppresses message output.

However, the following messages are outside the scope of suppression:

  • Error messages for analyzing options

  • For compression operations, messages that confirm whether you want to overwrite an existing file that has the same name as the compressed file

  • For decompression operations, messages that confirm whether you want to overwrite an existing file that has the same name as the decompressed file.

[For display operations]

Does not display the following information:

  • Header line

  • Total information of multiple compressed files

If the -v option is specified after this option, the specification for this option is canceled.

-v

--verbose

Displays the following information:

  • For compression operations, decompression operations, and verification operations, the content indicated in Table 8-12 Detailed information output for compression operations, decompression operations, and verification operations are output to the standard error output as the detailed information of the operation result.

  • In a display operation, detailed information such as the compression method is also displayed in the compressed file information. For details about the content to be displayed, see Displaying compressed file information.

  • When files in a directory are searched with the -r option specified, the following message is output to the standard error output, for files that are outside the scope of the operation.

    [For compression operations]

    For compressed files: gzip: file-name already has suffix suffix -- unchanged is output.

    [For decompression operations, display operations, and verification operations]

    For files other than compressed files: gzip: file-name: Unknown suffix: ignored is output.

If the -q option is specified after this option, the specification for this option is canceled.

Table 8‒12: Detailed information output for compression operations, decompression operations, and verification operations

Operation type

Content# and description of the detailed information (top line: content, bottom line: description)

Compress

[name-of-the-file-to-be-compressed: ]compression-ratio%[ -- replaced with compressed-file-name]

Outputs the name of the file to be compressed, the compression ratio, and the name of the compressed file.

When the -c option is specified, the compressed file name is not output.

When entered from the standard input, the name of the file to be compressed and the compressed file name are not output.

Decompress

compressed-file-name: compression-ratio%[ -- replaced with file-name-after-decompression]

Outputs the name of the compressed file, the compression ratio, and the name of the file after decompression.

When the -c option is specified, the name of the file after decompression is not output.

When entered from the standard input, no detailed information is output.

Verify

[compressed-file-name: ] OK

Outputs OK, which indicates that there are no problems in integrity between the name of the compressed file and the compressed file data.

When entered from the standard input, the name of the compressed file is not output.

#
  • Displays name-of-the-file-to-be-compressed: in name-of-the-file-to-be-compressed:tab-character.

  • Displays compressed-file-name: in compressed-file-name:tab-character.

Return codes

Return code

Meaning

0

Normal termination.

1

Termination with an error.

The results of compression operations and decompression operations are as follows:

[For compression operations]

The compressed files are not created.

[For decompression operations]

The decompressed files are not created.

2

Termination with an error.

The results of compression operations and decompression operations are as follows:

[For compression operations]

The compressed files are created. An error occurred at post-processing. For details about post-processing when an error occurs, see the output messages.

[For decompression operations]

The decompressed files are created. An error occurred at post-processing. For details about post-processing when an error occurs, see the output messages.

Note that when an operation is performed on multiple files and errors for both the return codes 1 and 2 occur, 1 is returned as the return code.

3

An invalid option has been specified.

The return code is 1 when the following message is output:

Handling of the most recent access date and time or the most recent modification date and time for a file

In compression operations and decompression operations, the most recent access date and time or the most recent modification date and time for a file is used as follows:

Handling of user IDs, group IDs, and permissions in compression and decompression operations

In UNIX, user IDs, group IDs, and permissions of files are handled as follows:

[For compression operations]

User IDs, group IDs, and permissions of files to be compressed are inherited by the compressed files.

[For decompression operations]

User IDs, group IDs, and permissions of compressed file are inherited by the decompressed files.

In addition, user IDs, group IDs, and permissions are handled as follows:

In Windows, the file owner, ACL, and file attributes are not inherited.

Handling of the extensions of compressed files

This section explains the handling of the extensions of compressed files. Note that to enter the files to be compressed or the compressed files from the standard input, there is no need to be aware of the file extension.

  1. Handling of files that are compressed by using compression operations

    In a compression operation, when an extension .gz or .tgz, or the suffix specified in the -S option is attached to the name of the file to be compressed, the file is assumed to have been compressed, and compression is not performed. In addition, for files that are already compressed, the message gzip: file-name already has suffix suffix -- unchanged is output.

    If the -r option is specified, compression is not performed on already-compressed files found in the directory. Furthermore, the message gzip: file-name already has suffix suffix -- unchanged is not output. Note that the message is output when the -v option is specified.

    When the -c option is specified, compressed files are also compressed.

  2. Extensions of compressed files that are targets for decompression, display, or verification

    In decompression operations, verification operations, and display operations, extensions for compressed files are handled as follows:

    • When specifying compressed file names in the arguments

      [For decompression operations]

      When the extension .gz or .tgz, or the suffix specified in the -S option is attached to the compressed file name, the file is assumed to be a compressed file and decompression is performed. For other files, decompression is not performed. In addition, for the specified file, the message gzip: file-name: Unknown suffix: ignored is output.

      [For display operations and verification operations]

      The operation is performed even when the extension .gz or .tgz, or the suffix specified in the -S option is not attached to the compressed file name.

    • When searching the directory by specifying the -r option

      The operation is performed on files that exist in the directory and have the extension .gz or .tgz, or the suffix specified in the -S option. The operation is not performed on files that do not have the extension .gz or .tgz, or the suffix specified in the -S option. Furthermore, the message gzip: file-name: Unknown suffix: ignored is not output. Note that the message is output when the -v option is specified.

      In the decompression operations, note that when the -c option is specified, decompression is attempted even when the file name does not have the extension .gz or .tgz, or the suffix specified in the -S option.

  3. Handling of character types for extensions

    Checking of the extensions of compressed files is not case-sensitive for the extensions .gz and .tgz, and the suffix specified in the -S option. For example, a file is assumed to be compressed even if its file name is file.GZ.

  4. Supplement of the extensions of compressed file names

    In decompression operations, display operations, and verification operations, the compressed file names can be specified in the arguments in the following ways:

    • When the extension of the compressed file is .gz, the description for .gz can be omitted.

    • When the compressed file name ends with the suffix specified in the -S option, the description for the suffix can be omitted.

    The .gz extension and the suffix specified in the -S option can be supplemented by the command.

    However, for compressed files with the extension .tgz, the description for .tgz cannot be omitted.

    The following shows an example of supplementing the extension .gz to the compressed file specified in the arguments:

    $ ls
    file1.txt.gz
    $ gzip -d file1.txt
    $ ls
    file1.txt

Note that when more than one file is stored in the directory that is being operated, the system works as follows:

When an extension is supplemented, handling of the extension .gz and the uppercase or lowercase characters specified in the suffix for the -S option depends on the OS.

[In UNIX]

Supplementation is case-sensitive.

  • The extension .gz

    Supplementation can be performed on compressed files that have the lowercase extension .gz.

    Supplementation cannot be performed on compressed files that have the extension .GZ, .gZ, or .Gz.

  • The suffix specified in the -S option

    Supplementation can be performed on compressed files that have the suffix specified in the -S option.

    Supplementation cannot be performed on compressed files whose suffix has a different configuration of uppercase and lowercase letters from the specified suffix.

[In Windows]

Supplementation is not case-sensitive.

  • The extension .gz

    Supplementation can be performed on compressed files that have the lowercase extension .gz, or any of the extensions .GZ, .gZ, and .Gz.

  • The suffix specified in the -S option

    Supplementation can be performed on compressed files that have the suffix specified in the -S option.

    Supplementation can also be performed on compressed files whose suffix has a different configuration of uppercase and lowercase letters from the specified suffix.

Displaying compressed file information

When the information of a compressed file is displayed, first the item name is displayed in the header line, and then the compressed file information is displayed in the next line. Display of the header line can be suppressed by using the -q option.

  1. Items to be displayed

    Displays the following items (rows): Items method, crc, date, and time are displayed when the -v option is specified.

    Table 8‒15: Items (rows) displayed for compressed file information

    Item name

    Content

    method

    Indicates the compression method. Displays the following values:

    defla: The compressed data is compressed by using the DEFLATE compression method.

    crc

    Indicates the value of the cyclical redundancy check (CRC) of the file data before compression. The value is displayed in 8-digit hexadecimal numbers.

    The integrity of the compressed file data is verified by using this value.

    When a file of size 0 is compressed, 00000000 is displayed.

    When a compressed file is entered from the standard input, ffffffff is displayed#1.

    date

    Indicates the month and day of the most recent modification date and time of the file. This month and day is to be set for the file after decompression. The year is not displayed.

    The content to be displayed differs depending on the input source and the specified options of the compressed file.

    For details, see Table 8-16 Date and time display.

    time

    Indicates the hour and minute of the most recent modification date and time of the file. This hour and minute is to be set for the file after decompression. Seconds are not displayed.

    The content to be displayed differs depending on the input source and the specified options of the compressed file.

    For details, see Table 8-16 Date and time display.

    compressed

    Indicates the size of the compressed file.

    When a compressed file is entered from the standard input, -1 is displayed#1.

    uncompressed

    Indicates the file size before compression.

    When a compressed file is entered from the standard input, -1 is displayed#1.

    When the file size before compression is 4 GB or greater, the value might not be displayed correctly#2.

    ratio

    Indicates the compression ratio (%). Displays the value up to the first decimal place.

    The compression ratio is calculated based on the file size before compression and the length of the compressed data in the compressed file. Note that the length of the compressed data is different from the size of the compressed file.

    When -1 is displayed in the compressed or uncompressed items, 0.0% is displayed.

    When compressing a small file or a file whose compression effect is small, the compression ratio might be negative.

    uncompressed_name

    Indicates the name of the file after decompression. When the compressed file name is specified from the directory path name, a path name consisting of the directory part of the path name and the file name after decompression is displayed. When the compressed file is entered from the standard input, stdout is displayed.

    The content to be displayed differs depending on the input source and the specified options of the compressed file.

    For details, see Table 8-17 Display of the uncompressed_name item.

    #1

    If you specify the -t option, you can display the same content as if you had entered from the compressed file, even when entering from the standard input. However, depending on the size of the compressed file, it might take some time to display the information.

    #2

    To display files that are 4 GB or greater, use the -t option. However, it might take some time to display the information.

    Table 8‒16: Date and time display

    Input source of the compressed file

    Storage of the most recent modification date and time in the compressed file#1

    Options to be specified#2

    Month, day, hour, and minute of the most recent modification date and time to be displayed

    File

    Stored

    -N

    The most recent modification date and time stored in the compressed file (the most recent modification date and time of the files before compression)

    -n

    The most recent modification date and time of the compressed file itself

    Not stored

    -N

    The most recent modification date and time of the compressed file itself

    -n

    The most recent modification date and time of the compressed file itself

    Standard input

    Stored

    -N

    The most recent modification date and time stored in the compressed file (the most recent modification date and time of the files before compression)

    -n

    Date and time of command execution

    Not stored

    -N

    Date and time of command execution

    -n

    Date and time of command execution

    #1

    Whether the most recent modification date and time will be stored in the compressed file is determined by the input method or the option specifications of the file to be compressed by the compression operation. For details about using the most recent modification date and time in compression operations, see Handling of the most recent access date and time or the most recent modification date and time for a file.

    #2

    If neither the -N nor -n option is specified, the -n option is assumed.

    Table 8‒17: Display of the uncompressed_name item

    Input source of the compressed file

    Storage of the file name in the compressed file#1

    Options to be specified#2

    File name after decompression

    File

    Stored

    -N

    The name of the file stored in the compressed file (name of the files before compression)

    -n

    The name of the file generated from the compressed file name (such as by removing the extension of the compressed file)

    Not stored

    -N

    The name of the file generated from the compressed file name (such as by removing the extension of the compressed file)

    -n

    The name of the file generated from the compressed file name (such as by removing the extension of the compressed file)

    Standard input

    Stored

    -N

    The name of the file stored in the compressed file (name of the files before compression)

    -n

    stdout

    Not stored

    -N

    stdout

    -n

    stdout

    #1

    Whether the file name will be stored in the compressed file is determined by the input method or the specification of the -N or -n option for the file that is to be compressed by the compression operation. For details about the file name to be stored in the compressed file, see the description of the arguments for the -N and -n options.

    #2

    If neither the -N nor -n option is specified, the -n option is assumed.

  2. Displaying the total information of multiple compressed files

    When specifying multiple compressed files in an argument or when targeting all compressed files in a directory by using the -r option, the compressed file information for each file is displayed first, and then the total information of multiple compressed files is displayed in the last line. The displayed content is shown in Table 8-18 Display of the total information of multiple compressed files.

    Displaying this information can be suppressed by using the -q option. In addition, when input from the standard input is included (where -1 is displayed in compressed or uncompressed) in the files to be displayed, this information is not displayed.

    Table 8‒18: Display of the total information of multiple compressed files

    Item name

    Content

    compressed

    Indicates the total size of the compressed files.

    uncompressed

    Indicates the total file size before compression.

    ratio

    Indicates the compression ratio calculated based on the total compressed file size and the total length of the compressed file data.

    uncompressed_name

    (totals)

Handling of link files

This command uses link files (symbolic links or hard links) as follows:

[For compression operations and decompression operations]

In compression operations and decompression operations, link files for files to be compressed or for compressed files cannot be operated. However, you can operate link files by specifying the -f option. The behavior when link files are operated while the -f option is specified is as follows:

Operation type

Behavior when link files are operated

Compress

  • Compresses the file data of the link destination.

  • When generating the compressed file name from a file name, generates from the link file name.

  • Stores the link file name as the file name to be stored in the compressed file.

  • Deletes the link files after compression.

Decompress

  • Decompresses the compressed data of the file in the link destination.

  • When generating the decompressed file name from a file name, uses the link file name.

  • Deletes the link files after decompression.

Furthermore, specify the -k option if you do not want to delete the link file after compression or decompression.

You can operate link files by specifying the -c option.

Symbolic links to a directory can be used to search within a directory by specifying the -r option. However, the -f option must be specified at the same time as the -r option. When the -f option is specified, the destinations of symbolic links to a directory are followed. In addition, when a directory is searched recursively, the destinations of symbolic links to encountered directories are followed. Note that when the -c option is specified, the destinations of symbolic links to directories are followed.

[For display operations and verification operations]

Link files can be used in display operations and verification operations. When a link file is specified for the compressed file, the link destination is followed and the compressed file at the link destination is referenced for display or verification. However, when a file name after decompression is displayed in a display operation, the name generated from the link file name is displayed instead of the compressed file name at the link destination.

When a search is performed within a directory by specifying the -r option, symbolic links to directories are followed to their destination. In addition, when a directory is searched recursively, the destinations of symbolic links to encountered directories are followed.

Notes

Examples