Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 950
american-ninja-warrior Avatar asked Jun 28 '17 16:06

american-ninja-warrior


People also ask

What are TGZ files?

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.

How do I unpack a TGZ file?

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.


1 Answers

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

tar czvf /tmp/empty.tgz --files-from=/dev/null
like image 56
PSkocik Avatar answered Nov 03 '22 00:11

PSkocik