cli-tarHow do I remove a file from a Unix tar archive?
To remove a file from a Unix tar archive, use the tar
command with the --delete
option.
For example, to remove file.txt
from the archive archive.tar
, run the following command:
tar --delete -f archive.tar file.txt
The command will delete file.txt
from the archive without extracting it.
The command consists of the following parts:
tar
- the command to manipulate tar archives--delete
- the option to delete a file from the archive-f
- the option to specify the archive filearchive.tar
- the tar archive from which the file will be deletedfile.txt
- the file to be deleted from the archive
For more information, see the GNU tar manual.
More of Cli Tar
- How can I use tar commands to zip a file?
- How do I use the command line to tar and zip a file?
- How do I use the shell to tar and zip files?
- 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 files?
- How do I use gzip, tar, and zip to compress files?
- How do I use the command line to tar and zip a file?
- How do I use the Unix tar xzvf command?
- How do I use the command line to tar and zip a file?
See more codes...