This is a plugin for ranger file manager that makes it much easier to compress and extract archives. It depends on archivers/compression programs such as tar
, zip
, 7z
, etc. It also supports and prioritizes parallelized versions of compression programs (like pbzip2
, pigz
, pixz
, etc).
If you find this plugin useful, please consider donating any amount of money. This will help me spend more time on supporting open-source software.
Clone this repo into ranger plugins folder. In Linux, it is typically located here: ~/.config/ranger/plugins
.
cd ~/.config/ranger/plugins
git clone https://github.com/maximtrp/ranger-archives.git
The following commands are available:
:extract [DIRECTORY]
: extracting files to a current or specified directory (optional).:extract_raw [FLAGS]
: extracting files with specific flags (optional).:extract_to_dirs [FLAGS]
: extracting each archive to a separate directory. E.g.:1.zip
to dir1
,2.zip
to dir2
, etc.:compress [FLAGS] [FILENAME.EXT]
: compressing selected/marked files/directories to an archive. If an archive filename is not specified, it will be named after a parent dir.
Select an archive and type:
:extract some_dir
Or even just:
:extract
This is an example of extracting a zip archive to a directory dirname
and escaping all non-ASCII Unicode chars:
:extract_raw -U -d dirname
Select a file or a folder (or multiple files and folder) in ranger and enter:
:compress files.zip
or (use quotation marks with filenames containing spaces)
:compress "my important files.zip"
zip
archiver provides a flag for better compression ratio -9
(just like gzip
and many others).
We can just add it before an archive filename:
:compress -9 file.zip
The other flags can be used likewise.
You can also add these lines to ~/.config/ranger/rc.conf
to use these keyboard shortcuts (ec
, ex
):
map ex extract
map ec compress