Ranger - Console File Manager

Posted on Apr 19, 2023

Home: https://github.com/ranger/ranger

Ranger is a minimalistic console file manager that provides it user with a nice simple curses interface. Note that Ranger is written in Python so it tends to run slower than other similar file managers.

Installation

To install Ranger use your systems package manger. See below for some examples.

## Arch
sudo pacman -S ranger
## Void
sudo xbps-install -S ranger
## Debian/Ubuntu
sudo apt install ranger
## macOS
brew install ranger

Configuration

Ranger does not need any configuration to work out of box but if you would like utilize it to its fullest potential then some configuration is needed. I will go over some basic configurations you can do to improve the overall experience but first you must run the below command.

The below command copies the default configuration files to your local your user directory "~/.config/ranger". Going forward any configuration needs to be done on the files located in this directory.

# Copy default configuration files.
ranger --copy-config=all

Configuration - Image Display (Optional)

Out of box Ranger will not display image previews. This can be annoying for some people that would like to preview files before opening them. There are actually a few ways to do this but it really depends on multiple factors, specifically what terminal you are using. In this instance I will show you the most common method which is using w3m.

The first thing you need to do is install w3m with the image drawing feature. See below.

## Arch
sudo pacman -S w3m
## Void
sudo xbps-install -S w3m-img
## Ubuntu/Debian
sudo apt install w3m-img

In your "~/.config/ranger/rc.conf" files add or uncomment the following line.

set preview_images true

Usage

To use Ranger just run it from your terminal like below.

ranger

Usage - Movements

Ranger uses Vim key bindings for movement, so if your familiar with Vim you will find Ranger a delight. But if you don’t know anything about Vim and don’t want to know then you can use the standard arrow keys also.

Up: “k” or ↑

Down: “j” or ↓

Left: “h” or ←

Right: “l” or →

Usage - Help

Ranger also lets you execute commands, to see a list of the commands and keybindings press "?" and then press “k”. You should be able to see the entire list.

Usage - Default Applications

Ranger comes configured to open certain files using specific applications. To see what these applications are look at the "~/.config/ranger.rifle.conf" file for the entire list or see below for the most common ones. You will want to ensure you have at least one of these applications installed for the various files you will interact with.

Video/Audio Files:

PDF Files:

Image Files:

End

If you do not want to use a GUI but are still not ready to “ls -al” to death then give Ranger a try. I think you will find that it is very helpful when you want to quickly browse your files.