bash: /bin/tar: Argument list too long when compressing many files with tar

后端 未结 2 1082
一个人的身影
一个人的身影 2021-02-01 20:44

I am trying compress files from an archive with the command

tar -czvf compress_file.tar.gz $(cat file_list.txt)

And I have an error

         


        
2条回答
  •  清歌不尽
    2021-02-01 20:59

    Use the "-T" option to pass a file to tar that contains the filenames to tar up.

    tar -cv -T file_list.txt -f tarball.tar
    

提交回复
热议问题