programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
Programming FAQs

How to delete a file from tar file(archive) without untar it

You can't request more than 20 challenges without solving them. Your previous challenges were flushed.

We can do this with the tar

We can do this with the tar command itself using option "-f"

- f The archive file name is given on the command line , required when tar output is going to file

syntax
tar -f {file_name.tar} --delete file1 file2 file3


tar -f myfile.tar --delete index.php folder1/test/testfile.php folder2/test_folder/*

above command deletes the index.php file, testfile.php from in folder1/test and all files of folder2/ test_folder