A lightweight bash utility for extracting common archive formats on Linux and Unix-like systems. Just pass a file and Extracter automatically detects the format and extracts it using the appropriate tool.
- .tar - tar archives
- .tar.gz, .tgz - gzip-compressed tar archives
- .tar.bz2, .tbz2 - bzip2-compressed tar archives
- .tar.xz, .txz - xz-compressed tar archives
- .gz - gzip compressed files
- .bz2 - bzip2 compressed files
- .xz - xz compressed files
- .zip - zip archives
- .rar - rar archives
- .7z - 7-zip archives
- .tar.z - old-style compressed tar
./ext.sh file.tar.gzOr add it to your ~/.bashrc / ~/.zshrc for global access:
alias ext='./ext.sh'Then extract any archive with:
ext myfile.zip-
Download the script:
curl -O https://raw.githubusercontent.com/rootkit-io/Extracter/main/ext.sh
-
Make it executable:
chmod +x ext.sh
-
(Optional) Move it to your PATH:
sudo mv ext.sh /usr/local/bin/ext
Make sure you have the necessary tools installed for the formats you want to extract:
tar(usually pre-installed)gzip/gunzipbzip2/bunzip2xz/unxzunzipunrarp7zip/7z
On Debian/Ubuntu:
sudo apt install tar gzip bzip2 xz-utils unzip unrar p7zip-fullOn Arch Linux:
sudo pacman -S tar gzip bzip2 xz unzip unrar p7zipMIT License - see LICENSE for details.