LoginSignup
1
1

More than 3 years have passed since last update.

gzipメモ

Posted at

ファイルを最大圧縮率で圧縮

# gzip -9 ファイル名

ファイルを圧縮させながら別の場所に吐き出させる場合

# cat error_log | gzip -9 >> /tmp/error_log.gz

圧縮させたファイルの中身を見たいだけなら

# zcat 圧縮ファイル名

通常のファイルをlessで確認するのと同様にしたいならzless

# zless 圧縮ファイル名

圧縮ファイルの中で特定の文字列を含む箇所を見つけたい時は zgrep が使える

# zgrep 文字列 圧縮ファイル名

これも同様の結果
# zcat 圧縮ファイル名 | grep 文字列

tar+gzip圧縮(tar zcpvf xxx.tgz aaa bbb)したファイルの中身は less で確認できる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1