コマ問
- フォーラムは新サイトへ移行しました。
- このフォーラムではゲスト投稿が禁止されています
コマ問
msg# 1
T3TR4
投稿数: 1
LPIC-1のコマ問について
「file」ファイルをgzip形式で「file.gz」というファイルに圧縮したい。
また、圧縮前の元ファイルも残したい。適切なコマンドは?
正解は「gzip -c file > file.gz」となっていますが、
圧縮前のファイルを残す場合のオプションは-kではありませんでしょうか?
「file」ファイルをgzip形式で「file.gz」というファイルに圧縮したい。
また、圧縮前の元ファイルも残したい。適切なコマンドは?
正解は「gzip -c file > file.gz」となっていますが、
圧縮前のファイルを残す場合のオプションは-kではありませんでしょうか?
Re: コマ問
msg# 1.1
quensan
投稿数: 119
-kというオプションはありませんね。-cで合っているようですよ。
=========
$ gzip --help
Usage: gzip [OPTION]... [FILE]...
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
-c, --stdout write on standard output, keep original files unchanged
-d, --decompress decompress
-f, --force force overwrite of output file and compress links
-h, --help give this help
-l, --list list compressed file contents
-L, --license display software license
-n, --no-name do not save or restore the original name and time stamp
-N, --name save or restore the original name and time stamp
-q, --quiet suppress all warnings
-r, --recursive operate recursively on directories
-S, --suffix=SUF use suffix SUF on compressed files
-t, --test test compressed file integrity
-v, --verbose verbose mode
-V, --version display version number
-1, --fast compress faster
-9, --best compress better
--rsyncable Make rsync-friendly archive
With no FILE, or when FILE is -, read standard input.
Report bugs to <bug-gzip@gnu.org>.
=========
$ gzip --help
Usage: gzip [OPTION]... [FILE]...
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
-c, --stdout write on standard output, keep original files unchanged
-d, --decompress decompress
-f, --force force overwrite of output file and compress links
-h, --help give this help
-l, --list list compressed file contents
-L, --license display software license
-n, --no-name do not save or restore the original name and time stamp
-N, --name save or restore the original name and time stamp
-q, --quiet suppress all warnings
-r, --recursive operate recursively on directories
-S, --suffix=SUF use suffix SUF on compressed files
-t, --test test compressed file integrity
-v, --verbose verbose mode
-V, --version display version number
-1, --fast compress faster
-9, --best compress better
--rsyncable Make rsync-friendly archive
With no FILE, or when FILE is -, read standard input.
Report bugs to <bug-gzip@gnu.org>.
Re: コマ問
msg# 1.2
arashi1977
居住地: 広島
投稿数: 1715
引用:gunzipと混同してませんか…?
圧縮前のファイルを残す場合のオプションは-kではありませんでしょうか?
Re: コマ問
msg# 1.3
yogume
投稿数: 1
Gzip 1.3.11 (2007-02-05)で仕様が変更されています。
Major changes in Gzip 1.3.11 (2007-02-05)
* As per the GNU coding standards, the behavior of gzip and its
companion executables no longer depend on the name used to invoke them.
For example, 'gzip' and 'gunzip' are no longer hard links;
instead, 'gunzip' is now a small program that invokes 'gzip -d'.
* zdiff now checks for subsidiary gzip failures, and works around
bugs in IRIX 6 sh, Tru64 4.0F ksh, and Solaris 8 bash.
現行のバージョン(rhel8互換OS)に付属するgzipでも '-k' が使用可能です。
------
$ gzip -h
Usage: gzip [OPTION]... [FILE]...
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
-c, --stdout write on standard output, keep original files unchanged
-d, --decompress decompress
-f, --force force overwrite of output file and compress links
-h, --help give this help
-k, --keep keep (don't delete) input files
-l, --list list compressed file contents
-L, --license display software license
-n, --no-name do not save or restore the original name and timestamp
-N, --name save or restore the original name and timestamp
-q, --quiet suppress all warnings
-r, --recursive operate recursively on directories
--rsyncable make rsync-friendly archive
-S, --suffix=SUF use suffix SUF on compressed files
--synchronous synchronous output (safer if system crashes, but slower)
-t, --test test compressed file integrity
-v, --verbose verbose mode
-V, --version display version number
-1, --fast compress faster
-9, --best compress better
With no FILE, or when FILE is -, read standard input.
Report bugs to <bug-gzip@gnu.org>.
------
Major changes in Gzip 1.3.11 (2007-02-05)
* As per the GNU coding standards, the behavior of gzip and its
companion executables no longer depend on the name used to invoke them.
For example, 'gzip' and 'gunzip' are no longer hard links;
instead, 'gunzip' is now a small program that invokes 'gzip -d'.
* zdiff now checks for subsidiary gzip failures, and works around
bugs in IRIX 6 sh, Tru64 4.0F ksh, and Solaris 8 bash.
現行のバージョン(rhel8互換OS)に付属するgzipでも '-k' が使用可能です。
------
$ gzip -h
Usage: gzip [OPTION]... [FILE]...
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
-c, --stdout write on standard output, keep original files unchanged
-d, --decompress decompress
-f, --force force overwrite of output file and compress links
-h, --help give this help
-k, --keep keep (don't delete) input files
-l, --list list compressed file contents
-L, --license display software license
-n, --no-name do not save or restore the original name and timestamp
-N, --name save or restore the original name and timestamp
-q, --quiet suppress all warnings
-r, --recursive operate recursively on directories
--rsyncable make rsync-friendly archive
-S, --suffix=SUF use suffix SUF on compressed files
--synchronous synchronous output (safer if system crashes, but slower)
-t, --test test compressed file integrity
-v, --verbose verbose mode
-V, --version display version number
-1, --fast compress faster
-9, --best compress better
With no FILE, or when FILE is -, read standard input.
Report bugs to <bug-gzip@gnu.org>.
------