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
2,579
Replies
19
Views
3,443
Recommended Threads
Replies
1
Views
1,894
Replies
24
Views
10,574
Replies
2
Views
2,537
Replies
2
Views
1,658
Replies
4
Views
1,897

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