2 ms·
extract() { bsdtar -xf "$1" } you can decompress things which are not files, such as stdin or device files. in addition, your code does not cover *.tar.x
by Hello71 6y ago
extract() {
bsdtar -xf "$1"
}
you can decompress things which are not files, such as stdin or device files. in addition, your code does not cover *.tar.xz (more common than tar.bz2 nowadays), or lzma, or lz4, or tar.zst, or many many other formats. further, it's not even consistent: bunzip2, gunzip, and unxz remove the input file, but tar, unrar, 7z, and zstd do not.