LoginSignup
1
1

More than 5 years have passed since last update.

gzip 圧縮したテキストファイルに、解凍せずに追記する

Last updated at Posted at 2017-11-09

目的

  • 題記の通り、gzip 圧縮したテキストファイルに追記したいけど、「解凍→追記→圧縮」が面倒

環境

centos-release
$ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
gzip
$ gzip --version
gzip 1.5
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.

やってみる

$ echo "January" |gzip -c >> month.gz
$ echo "February" | gzip -c >> month.gz
$ zcat month.gz
出力結果
January
February

OK!

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