cli-tarHow do I tar and gzip data from stdin?
Tar is a program used to archive and compress files or directories. Gzip is a program used to compress files. To tar and gzip data from stdin, the following command can be used:
$ tar -czf - <input_file>
This command will compress the <input_file>
and output the result to stdout.
The code can be broken down into the following parts:
tar
- the program used to archive and compress files-czf
- flags used to indicate that the command should create a tar archive and compress it with gzip-
- the output should be written to stdout<input_file>
- the file to be archived and compressed
The output of this command will be the compressed tar archive written to stdout.
Helpful links
More of Cli Tar
- How do I use the Unix tar xvf command to extract files?
- How do I use the command line to tar and zip files?
- How can I use tar commands to zip a file?
- How do I use the Unix tar zip command?
- How do I create a tar.zip file in Unix?
- How do I use the command line to tar and distribute files?
- How do I use gzip, tar, and zip to compress files?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and zip a file?
- How do I use the command line to tar and zip a file?
See more codes...