How do I delete a single file from a tar.gz archive
I have a huge tarbell archive with an excessively large or corrupt error_log that causes the archive to hang when attempting to extract it. Is there a way to remove this from the archive before unzipping or extract the archive without extracting that specific file on Mac OS X terminal?
I found this post on how to efficiently-remove-files-from-large-tgz however, I tried the --delete flag, but received this error:
tar: Option --delete is not supported
Is there a way to:
- remove the file from the archive without unzipping it?
- extract the archive but exclude the file?
tar gz
add a comment |
I have a huge tarbell archive with an excessively large or corrupt error_log that causes the archive to hang when attempting to extract it. Is there a way to remove this from the archive before unzipping or extract the archive without extracting that specific file on Mac OS X terminal?
I found this post on how to efficiently-remove-files-from-large-tgz however, I tried the --delete flag, but received this error:
tar: Option --delete is not supported
Is there a way to:
- remove the file from the archive without unzipping it?
- extract the archive but exclude the file?
tar gz
Which version oftarare you using? If its outdated then try to update to the latest version and check themanpage iftarsupports--deleteas an option.
– Santosh A
Jun 21 '15 at 8:21
1
The--deleteoption is specific to sometarprograms (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the.tar.gzfile, extract everything from the archive, delete the unwanted file, and then rebuild the archive.
– Peter
Jun 21 '15 at 8:24
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09
add a comment |
I have a huge tarbell archive with an excessively large or corrupt error_log that causes the archive to hang when attempting to extract it. Is there a way to remove this from the archive before unzipping or extract the archive without extracting that specific file on Mac OS X terminal?
I found this post on how to efficiently-remove-files-from-large-tgz however, I tried the --delete flag, but received this error:
tar: Option --delete is not supported
Is there a way to:
- remove the file from the archive without unzipping it?
- extract the archive but exclude the file?
tar gz
I have a huge tarbell archive with an excessively large or corrupt error_log that causes the archive to hang when attempting to extract it. Is there a way to remove this from the archive before unzipping or extract the archive without extracting that specific file on Mac OS X terminal?
I found this post on how to efficiently-remove-files-from-large-tgz however, I tried the --delete flag, but received this error:
tar: Option --delete is not supported
Is there a way to:
- remove the file from the archive without unzipping it?
- extract the archive but exclude the file?
tar gz
tar gz
edited Apr 13 '17 at 12:36
Community♦
11
11
asked Jun 21 '15 at 8:12
KillerDesignerKillerDesigner
1511214
1511214
Which version oftarare you using? If its outdated then try to update to the latest version and check themanpage iftarsupports--deleteas an option.
– Santosh A
Jun 21 '15 at 8:21
1
The--deleteoption is specific to sometarprograms (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the.tar.gzfile, extract everything from the archive, delete the unwanted file, and then rebuild the archive.
– Peter
Jun 21 '15 at 8:24
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09
add a comment |
Which version oftarare you using? If its outdated then try to update to the latest version and check themanpage iftarsupports--deleteas an option.
– Santosh A
Jun 21 '15 at 8:21
1
The--deleteoption is specific to sometarprograms (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the.tar.gzfile, extract everything from the archive, delete the unwanted file, and then rebuild the archive.
– Peter
Jun 21 '15 at 8:24
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09
Which version of
tar are you using? If its outdated then try to update to the latest version and check the man page if tar supports --delete as an option.– Santosh A
Jun 21 '15 at 8:21
Which version of
tar are you using? If its outdated then try to update to the latest version and check the man page if tar supports --delete as an option.– Santosh A
Jun 21 '15 at 8:21
1
1
The
--delete option is specific to some tar programs (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the .tar.gz file, extract everything from the archive, delete the unwanted file, and then rebuild the archive.– Peter
Jun 21 '15 at 8:24
The
--delete option is specific to some tar programs (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the .tar.gz file, extract everything from the archive, delete the unwanted file, and then rebuild the archive.– Peter
Jun 21 '15 at 8:24
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09
add a comment |
2 Answers
2
active
oldest
votes
As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:
tar -zxvf file.tar.gz --exclude "file_to_exclude"
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
add a comment |
Dear you can delete the archive file through the same format as we remove the directory from below command through
command:- rm -rf archive file name
r:- recursively
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30962501%2fhow-do-i-delete-a-single-file-from-a-tar-gz-archive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:
tar -zxvf file.tar.gz --exclude "file_to_exclude"
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
add a comment |
As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:
tar -zxvf file.tar.gz --exclude "file_to_exclude"
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
add a comment |
As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:
tar -zxvf file.tar.gz --exclude "file_to_exclude"
As mentioned in the comments it's not possible to remove the file using tar, but you can exclude the file when extracting:
tar -zxvf file.tar.gz --exclude "file_to_exclude"
edited Jun 21 '15 at 8:33
answered Jun 21 '15 at 8:27
msfostermsfoster
1,73311112
1,73311112
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
add a comment |
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
Worked like a charm. Thank you.
– KillerDesigner
Jun 21 '15 at 15:10
add a comment |
Dear you can delete the archive file through the same format as we remove the directory from below command through
command:- rm -rf archive file name
r:- recursively
add a comment |
Dear you can delete the archive file through the same format as we remove the directory from below command through
command:- rm -rf archive file name
r:- recursively
add a comment |
Dear you can delete the archive file through the same format as we remove the directory from below command through
command:- rm -rf archive file name
r:- recursively
Dear you can delete the archive file through the same format as we remove the directory from below command through
command:- rm -rf archive file name
r:- recursively
answered Nov 16 '18 at 1:10
VinodVinod
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30962501%2fhow-do-i-delete-a-single-file-from-a-tar-gz-archive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which version of
tarare you using? If its outdated then try to update to the latest version and check themanpage iftarsupports--deleteas an option.– Santosh A
Jun 21 '15 at 8:21
1
The
--deleteoption is specific to sometarprograms (notably the default available under linux). From memory, the default tar under macos does not support that. You'll need to read the man/help file, or obtain a program that supports such functionality. All else failing, unzip the.tar.gzfile, extract everything from the archive, delete the unwanted file, and then rebuild the archive.– Peter
Jun 21 '15 at 8:24
Santosh and Peter, thank you so much for your responses. Santosh, not sure which version of tar is running on Mac OS x nor how to update it. Peter, thanks too. This isn't an option, since extracting the archive fails due to how large the error_log is.
– KillerDesigner
Jun 21 '15 at 15:09