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
What is a TGZ file extension? A TGZ file is a TAR Archive file that has been compressed using Gnu Zip (gzip) software. Commonly used on UNIX and Linux systems, TAR archives bundle a collection of files into a single file for easier distribution or backup.
Understanding the tar command unpack . -z : Uncompress the resulting archive with gunzip command or gunzip command. -x : Extract to disk from the archive. -v : Produce verbose output i.e. show progress and file names while extracting files.
The switch you're looking for is --files-from
or -T
:
tar czvf /tmp/empty.tgz --files-from=/dev/null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With