Is there any program to provide a consistent interface across multiple archive types?
Clash Royale CLAN TAG#URR8PPP
At the moment, if I download a compressed file, it could be any of a .tar.gz archive, a tar.bz2 arhive, a .zip archive or a .gz archive. And each time I do so, I have to remember what the command line options for that program are.
Is there any CLI program where I can just go:
undocompression somefile.??
and let it figure out what format the archive is in? (overly long name used to avoid conflicting with any real program)
command-line archive compression
add a comment |
At the moment, if I download a compressed file, it could be any of a .tar.gz archive, a tar.bz2 arhive, a .zip archive or a .gz archive. And each time I do so, I have to remember what the command line options for that program are.
Is there any CLI program where I can just go:
undocompression somefile.??
and let it figure out what format the archive is in? (overly long name used to avoid conflicting with any real program)
command-line archive compression
I couldn't find or create any tags such asarchive
,compression
etc. Could someone else add the correct one?
– Macha
Aug 28 '10 at 15:43
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45
add a comment |
At the moment, if I download a compressed file, it could be any of a .tar.gz archive, a tar.bz2 arhive, a .zip archive or a .gz archive. And each time I do so, I have to remember what the command line options for that program are.
Is there any CLI program where I can just go:
undocompression somefile.??
and let it figure out what format the archive is in? (overly long name used to avoid conflicting with any real program)
command-line archive compression
At the moment, if I download a compressed file, it could be any of a .tar.gz archive, a tar.bz2 arhive, a .zip archive or a .gz archive. And each time I do so, I have to remember what the command line options for that program are.
Is there any CLI program where I can just go:
undocompression somefile.??
and let it figure out what format the archive is in? (overly long name used to avoid conflicting with any real program)
command-line archive compression
command-line archive compression
edited Nov 29 '10 at 12:45
asked Aug 28 '10 at 15:43
Macha
1,60142434
1,60142434
I couldn't find or create any tags such asarchive
,compression
etc. Could someone else add the correct one?
– Macha
Aug 28 '10 at 15:43
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45
add a comment |
I couldn't find or create any tags such asarchive
,compression
etc. Could someone else add the correct one?
– Macha
Aug 28 '10 at 15:43
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45
I couldn't find or create any tags such as
archive
, compression
etc. Could someone else add the correct one?– Macha
Aug 28 '10 at 15:43
I couldn't find or create any tags such as
archive
, compression
etc. Could someone else add the correct one?– Macha
Aug 28 '10 at 15:43
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45
add a comment |
8 Answers
8
active
oldest
votes
You can use p7zip. It automatically identifies the archive type and decompress it.
p7zip is the command line version of
7-Zip for Unix/Linux, made by an
independent developer.
7z e <file_name>
add a comment |
I found this little snippet a while ago and have been using it since. I just have it in my .bashrc file
extract ()
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
1
This is more effective than the accepted answer, since7z e foo.tar.gz
just leaves you with afoo.tar
file.
– Wilfred Hughes
May 17 '14 at 20:44
add a comment |
In Debian/Ubuntu there is the unp
package, which is a Perl script that acts as a frontend for many archiving utilities.
add a comment |
From another question: atool, which also handles various archive types and is more powerful than unp
because it also handles listing of contents, finding differences between archives etc.
add a comment |
GNU tar (and star) has at least some compression auto-detection capabilities:
tar xf foo.tar.gz
tar xf foo.tar.bz
just work.
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRCstar
is actually a more standardized way, where GNU's tar is a non standard extension.
– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
add a comment |
I think ark
the KDE archiving tool can be run without a GUI. From the ark
manpage
ark --batch archive.tar.bz2
Will extract archive.tar.bz2 into the current directory without showing any GUI.
Arks support of various archive formats depends on which apps you have installed (e.g. for rar it depends on unrar ), but I don't know of any formats it can't handle.
add a comment |
I'm surprised no one mentioned the dtrx tool that was suggested in this answer.
Seems to fit the request to a tee.
add a comment |
The Unarchiver supports extraction of about 50 different formats with a consistent interface.
By default, a directory is created if there is more than one top-level file or folder.
View its man
-page.
The command line version supports Linux and is available here.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f1340%2fis-there-any-program-to-provide-a-consistent-interface-across-multiple-archive-t%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use p7zip. It automatically identifies the archive type and decompress it.
p7zip is the command line version of
7-Zip for Unix/Linux, made by an
independent developer.
7z e <file_name>
add a comment |
You can use p7zip. It automatically identifies the archive type and decompress it.
p7zip is the command line version of
7-Zip for Unix/Linux, made by an
independent developer.
7z e <file_name>
add a comment |
You can use p7zip. It automatically identifies the archive type and decompress it.
p7zip is the command line version of
7-Zip for Unix/Linux, made by an
independent developer.
7z e <file_name>
You can use p7zip. It automatically identifies the archive type and decompress it.
p7zip is the command line version of
7-Zip for Unix/Linux, made by an
independent developer.
7z e <file_name>
answered Aug 28 '10 at 18:07
Hemant
4,15123138
4,15123138
add a comment |
add a comment |
I found this little snippet a while ago and have been using it since. I just have it in my .bashrc file
extract ()
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
1
This is more effective than the accepted answer, since7z e foo.tar.gz
just leaves you with afoo.tar
file.
– Wilfred Hughes
May 17 '14 at 20:44
add a comment |
I found this little snippet a while ago and have been using it since. I just have it in my .bashrc file
extract ()
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
1
This is more effective than the accepted answer, since7z e foo.tar.gz
just leaves you with afoo.tar
file.
– Wilfred Hughes
May 17 '14 at 20:44
add a comment |
I found this little snippet a while ago and have been using it since. I just have it in my .bashrc file
extract ()
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
I found this little snippet a while ago and have been using it since. I just have it in my .bashrc file
extract ()
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
answered Feb 18 '11 at 18:53
Dason
21349
21349
1
This is more effective than the accepted answer, since7z e foo.tar.gz
just leaves you with afoo.tar
file.
– Wilfred Hughes
May 17 '14 at 20:44
add a comment |
1
This is more effective than the accepted answer, since7z e foo.tar.gz
just leaves you with afoo.tar
file.
– Wilfred Hughes
May 17 '14 at 20:44
1
1
This is more effective than the accepted answer, since
7z e foo.tar.gz
just leaves you with a foo.tar
file.– Wilfred Hughes
May 17 '14 at 20:44
This is more effective than the accepted answer, since
7z e foo.tar.gz
just leaves you with a foo.tar
file.– Wilfred Hughes
May 17 '14 at 20:44
add a comment |
In Debian/Ubuntu there is the unp
package, which is a Perl script that acts as a frontend for many archiving utilities.
add a comment |
In Debian/Ubuntu there is the unp
package, which is a Perl script that acts as a frontend for many archiving utilities.
add a comment |
In Debian/Ubuntu there is the unp
package, which is a Perl script that acts as a frontend for many archiving utilities.
In Debian/Ubuntu there is the unp
package, which is a Perl script that acts as a frontend for many archiving utilities.
answered Aug 29 '10 at 15:47
JanC
1,28978
1,28978
add a comment |
add a comment |
From another question: atool, which also handles various archive types and is more powerful than unp
because it also handles listing of contents, finding differences between archives etc.
add a comment |
From another question: atool, which also handles various archive types and is more powerful than unp
because it also handles listing of contents, finding differences between archives etc.
add a comment |
From another question: atool, which also handles various archive types and is more powerful than unp
because it also handles listing of contents, finding differences between archives etc.
From another question: atool, which also handles various archive types and is more powerful than unp
because it also handles listing of contents, finding differences between archives etc.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Nov 29 '10 at 7:54
Thomas Themel
66654
66654
add a comment |
add a comment |
GNU tar (and star) has at least some compression auto-detection capabilities:
tar xf foo.tar.gz
tar xf foo.tar.bz
just work.
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRCstar
is actually a more standardized way, where GNU's tar is a non standard extension.
– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
add a comment |
GNU tar (and star) has at least some compression auto-detection capabilities:
tar xf foo.tar.gz
tar xf foo.tar.bz
just work.
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRCstar
is actually a more standardized way, where GNU's tar is a non standard extension.
– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
add a comment |
GNU tar (and star) has at least some compression auto-detection capabilities:
tar xf foo.tar.gz
tar xf foo.tar.bz
just work.
GNU tar (and star) has at least some compression auto-detection capabilities:
tar xf foo.tar.gz
tar xf foo.tar.bz
just work.
answered Aug 28 '10 at 15:49
maxschlepzig
33.5k32135211
33.5k32135211
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRCstar
is actually a more standardized way, where GNU's tar is a non standard extension.
– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
add a comment |
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRCstar
is actually a more standardized way, where GNU's tar is a non standard extension.
– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRC
star
is actually a more standardized way, where GNU's tar is a non standard extension.– xenoterracide
Aug 28 '10 at 17:05
It does depend on the version of tar which formats it can autodetect but other than that it works well... IIRC
star
is actually a more standardized way, where GNU's tar is a non standard extension.– xenoterracide
Aug 28 '10 at 17:05
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
Latest version of GNU tar can uncompress all compressed archives, which are created with any of the compression filter switches (z, j, J, --lzma), it will detect compression automatically.
– polemon
Nov 29 '10 at 15:58
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
@xenoterracide: Well, the author of star has criticized GNU tar a lot in his usual style - these writings could be biased (ignoring bad points about star and good points about GNU tar), contain probably some FUD and are probably outdated.
– maxschlepzig
Nov 29 '10 at 17:29
add a comment |
I think ark
the KDE archiving tool can be run without a GUI. From the ark
manpage
ark --batch archive.tar.bz2
Will extract archive.tar.bz2 into the current directory without showing any GUI.
Arks support of various archive formats depends on which apps you have installed (e.g. for rar it depends on unrar ), but I don't know of any formats it can't handle.
add a comment |
I think ark
the KDE archiving tool can be run without a GUI. From the ark
manpage
ark --batch archive.tar.bz2
Will extract archive.tar.bz2 into the current directory without showing any GUI.
Arks support of various archive formats depends on which apps you have installed (e.g. for rar it depends on unrar ), but I don't know of any formats it can't handle.
add a comment |
I think ark
the KDE archiving tool can be run without a GUI. From the ark
manpage
ark --batch archive.tar.bz2
Will extract archive.tar.bz2 into the current directory without showing any GUI.
Arks support of various archive formats depends on which apps you have installed (e.g. for rar it depends on unrar ), but I don't know of any formats it can't handle.
I think ark
the KDE archiving tool can be run without a GUI. From the ark
manpage
ark --batch archive.tar.bz2
Will extract archive.tar.bz2 into the current directory without showing any GUI.
Arks support of various archive formats depends on which apps you have installed (e.g. for rar it depends on unrar ), but I don't know of any formats it can't handle.
edited Aug 28 '10 at 17:04
answered Aug 28 '10 at 16:52
xenoterracide
25.4k52157221
25.4k52157221
add a comment |
add a comment |
I'm surprised no one mentioned the dtrx tool that was suggested in this answer.
Seems to fit the request to a tee.
add a comment |
I'm surprised no one mentioned the dtrx tool that was suggested in this answer.
Seems to fit the request to a tee.
add a comment |
I'm surprised no one mentioned the dtrx tool that was suggested in this answer.
Seems to fit the request to a tee.
I'm surprised no one mentioned the dtrx tool that was suggested in this answer.
Seems to fit the request to a tee.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Feb 1 '17 at 7:40
HighCommander4
1284
1284
add a comment |
add a comment |
The Unarchiver supports extraction of about 50 different formats with a consistent interface.
By default, a directory is created if there is more than one top-level file or folder.
View its man
-page.
The command line version supports Linux and is available here.
add a comment |
The Unarchiver supports extraction of about 50 different formats with a consistent interface.
By default, a directory is created if there is more than one top-level file or folder.
View its man
-page.
The command line version supports Linux and is available here.
add a comment |
The Unarchiver supports extraction of about 50 different formats with a consistent interface.
By default, a directory is created if there is more than one top-level file or folder.
View its man
-page.
The command line version supports Linux and is available here.
The Unarchiver supports extraction of about 50 different formats with a consistent interface.
By default, a directory is created if there is more than one top-level file or folder.
View its man
-page.
The command line version supports Linux and is available here.
answered Dec 24 '18 at 5:04
Tom Hale
6,62533588
6,62533588
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2funix.stackexchange.com%2fquestions%2f1340%2fis-there-any-program-to-provide-a-consistent-interface-across-multiple-archive-t%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
I couldn't find or create any tags such as
archive
,compression
etc. Could someone else add the correct one?– Macha
Aug 28 '10 at 15:43
@Tshepang: Fixed.
– Macha
Nov 29 '10 at 12:45