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

后端 未结 2 1080
一个人的身影
一个人的身影 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:55

    and how to make list of files to tar up: first ls > temp ## create the list of files to tar up then tar cvzf dicionario_ultra.tgz -X FILE -T temp and finally rm temp

    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题