Delete files or folders in a TAR.GZ or a ZIP file?

Mujkanovic

Well-known member
Collaborate
Registered
Joined
Apr 24, 2016
Messages
424
Points
18
I have a tar.gz and a zip file, how can I delete files or folders in these zip files if wanted? I only want to keep necessary files that I will use in the future . Is that possible to do that?
 

sam@12

Member
Registered
Joined
Jun 8, 2021
Messages
62
Points
6
Hello,

Yes, it is possible to delete files and folders in a tar.gz.

For example

the files file1 and file2 can be removed from file.tar.gz with the following:

tar -f file.tar.gz --delete file1 file2
To remove a directory dir1:

tar -f file.tar.gz --delete dir1/*
 
Newer Threads
Replies
17
Views
3,081
Replies
19
Views
4,007
Recommended Threads
Replies
50
Views
19,887
Replies
17
Views
4,877
  • Locked
Replies
0
Views
3,121

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top