ほぼ全ての機能を新サイトへ移行しました

コマ問

  • フォーラムは新サイトへ移行しました。
  • このフォーラムではゲスト投稿が禁止されています

報告 コマ問

msg# 1
前の投稿 - 次の投稿 | 親投稿 - 子投稿.1 .2 .3 | 投稿日時 2022-1-27 14:55 | 最終変更
T3TR4  新米   投稿数: 1
LPIC-1のコマ問について
「file」ファイルをgzip形式で「file.gz」というファイルに圧縮したい。
また、圧縮前の元ファイルも残したい。適切なコマンドは?

正解は「gzip -c file > file.gz」となっていますが、
圧縮前のファイルを残す場合のオプションは-kではありませんでしょうか?

なし Re: コマ問

msg# 1.1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2022-1-27 17:29
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>;.

なし Re: コマ問

msg# 1.2
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2022-1-30 0:55
arashi1977  長老 居住地: 広島  投稿数: 1715
引用:
圧縮前のファイルを残す場合のオプションは-kではありませんでしょうか?
gunzipと混同してませんか…?

なし Re: コマ問

msg# 1.3
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2022-2-8 9:46 | 最終変更
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>;.
------

  >フォーラム検索へ


Copyright (c) 2020 Ping-t All rights reserved.
ログイン
ユーザ名 or E-Mailアドレス:

パスワード:







プレミアムコンテンツ

受験チケット(割引)

Contact

LPI-Japan Logo

LPI Logo