V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
opensail
V2EX  ›  Linux

xz 解压文件竟然没有进度提示, orz,大佬们都是用什么压缩和解压文件的

  •  
  •   opensail · 2019-03-24 01:37:08 +08:00 · 3971 次点击
    这是一个创建于 1832 天前的主题,其中的信息可能已经有所发展或是发生改变。
    xz -help
    Usage: xz [OPTION]... [FILE]...
    Compress or decompress FILEs in the .xz format.

    -z, --compress force compression
    -d, --decompress force decompression
    -t, --test test compressed file integrity
    -l, --list list information about .xz files
    -k, --keep keep (don't delete) input files
    -f, --force force overwrite of output file and (de)compress links
    -c, --stdout write to standard output and don't delete input files
    -0 ... -9 compression preset; default is 6; take compressor *and*
    decompressor memory usage into account before using 7-9!
    -e, --extreme try to improve compression ratio by using more CPU time;
    does not affect decompressor memory requirements
    -q, --quiet suppress warnings; specify twice to suppress errors too
    -v, --verbose be verbose; specify twice for even more verbose
    -h, --help display this short help and exit
    -H, --long-help display the long help (lists also the advanced options)
    -V, --version display the version number and exit

    With no FILE, or when FILE is -, read standard input.
    7 条回复    2019-03-25 17:13:53 +08:00
    Yorwba
        1
    Yorwba  
       2019-03-24 03:12:22 +08:00 via Android
    可以考虑用 tqdm ( https://tqdm.github.io/)

    比如
    seq 1000000 | tqdm --bytes | xz - | tqdm --bytes --position 2 > /dev/null
    6.57MB [00:11, 598kB/s]

    183kB [00:11, 16.0kB/s]

    前者是未压缩的输入,后者是已压缩的输出。
    quinoa42
        2
    quinoa42  
       2019-03-24 03:54:24 +08:00 via Android   ❤️ 1
    tar -xJvf
    需要更进一步的进度的话可以看看 https://www.gnu.org/software/tar/manual/html_section/tar_25.html
    Tyanboot
        3
    Tyanboot  
       2019-03-24 13:36:27 +08:00   ❤️ 2
    xz 不是有进度条的吗,加一个 -v 参数。
    opensail
        4
    opensail  
    OP
       2019-03-24 19:23:25 +08:00
    @Yorwba 多谢了
    opensail
        5
    opensail  
    OP
       2019-03-24 19:24:16 +08:00
    @quinoa42 谢谢啦
    opensail
        6
    opensail  
    OP
       2019-03-24 19:25:18 +08:00
    @Tyanboot 哇,多谢大佬的指教,英文渣渣,加了一个大写的 V
    lucifer9
        7
    lucifer9  
       2019-03-25 17:13:53 +08:00
    可以考虑一下 pv
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2431 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:03 · PVG 00:03 · LAX 09:03 · JFK 12:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.