11
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

進捗確認しながらtarで圧縮/解凍

Last updated at Posted at 2017-10-09

よく使うけど、結構ぐぐるので、メモ

アーカイブ

圧縮はしない
元々圧縮されている画像ファイルとかをまとめるときに使う

$ tar cf data.tar data/

進捗を表示

$ tar cf - data/ | pc > data.tar
41MiB 0:27:21 [ 196KiB/s] [                                        <=>               ]

pvsオプションをつけると残り時間とかを表示してくれる

$ tar cf - data/ | pv -s $(du -sb data | awk '{print $1}') > data.tar
7.76MiB 0:00:42 [ 172KiB/s] [>                                        ]  0% ETA 22:20:37

圧縮

jオプションをつけると、bzip2で圧縮

$ tar jcf data.tar.gz2 data/

進捗を表示

$ tar cf - data/ | pv | bzip2 > data.tar.bz2
$ tar cf - data/ | pv -s $(du -sb data | awk '{print $1}') | bzip2 > data.tar.bz2

解凍

$ tar xf data.tar

進捗を表示

$ pv data.tar | tar xf -
11
13
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
11
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?