Gzip multiple files individually and keep the original files

后端 未结 4 810
自闭症患者
自闭症患者 2021-02-02 17:47

I am looking to gzip multiple files (into multiple .gz files) in a directory while keeping the originals.

I can do individual files using these commands:



        
4条回答
  •  独厮守ぢ
    2021-02-02 18:41

    Since you have multiple files, GNU Parallel might be useful:

    find . -type f -name "*cache.html" | parallel gzip '<{} >{}.gz'
    

    Watch the intro video for a quick introduction: https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1

提交回复
热议问题