cli-tarHow do I remove files using tar and gzip?
Using tar and gzip, you can remove files from an archive. The syntax to do so is tar -zvf <archive name> --delete <files to delete>
. Here is an example:
tar -zvf archive.tar.gz --delete file1.txt
This command will delete the file file1.txt
from the archive archive.tar.gz
.
The parts of the command are as follows:
tar
: the tar command-zvf
: tells tar to work with gzip-compressed archivesarchive.tar.gz
: the name of the archive--delete
: tells tar to delete the specified filesfile1.txt
: the name of the file to delete
For more information, please see the following links:
More of Cli Tar
- How do I use gzip, tar, and zip to compress 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 zip a file?
- How do I use the command line to tar and distribute files?
- How do I use the Unix tar xvf command to extract files?
- How do I use the command line to tar and zip a file?
- How do I use the shell to tar and zip files?
See more codes...