Search code examples
bashmacostarbsdgzip

How to create an empty tgz file?


How to create an empty tgz file? I tried

tar czvf /tmp/empty.tgz --from-file /dev/null
tar: Option --from-file is not supported

Solution

  • The switch you're looking for is --files-from or -T:

    tar czvf /tmp/empty.tgz --files-from=/dev/null