What Is Ranger? #
Ranger is a terminal-based file manager with a minimalistic and efficient interface. It provides a vi-like keybinding system, multi-pane directory views, and customizable behavior, making it a favorite among Linux power users and terminal lovers.
Why Use Ranger? #
- 🧭 Navigation Made Easy: Use familiar Vim-style keys to move between files.
- 🖼️ Previews: See file previews right in the terminal, including text and images (with
w3m
orueberzug
). - 🛠️ Customizable: Fully scriptable with Python and extensive config options.
- ⚡ Lightweight: No GUI overhead — just fast and responsive terminal UI.
Installation #
On Debian/Ubuntu: #
sudo apt update
sudo apt install ranger
On Arch Linux: #
sudo pacman -S ranger
On macOS (via Homebrew): #
brew install ranger
From Source: #
git clone https://github.com/ranger/ranger.git
cd ranger
sudo make install
Getting Started #
To start Ranger:
ranger
Basic keybindings:
h
/l
: Navigate left/right in the directory hierarchyj
/k
: Move down/upgg
/G
: Go to top/bottom:q
: Quit Rangeryy
/dd
: Yank/cut filep
/P
: Paste:shell <command>
: Run shell commands
Preview Support #
Install w3m
, ueberzug
, or catimg
for image previews.
Example (Debian):
sudo apt install w3m
To enable preview support:
ranger --copy-config=scope
Then edit ~/.config/ranger/scope.sh
to configure preview behavior.
Configuration #
Generate default configs:
ranger --copy-config=all
You’ll get:
rc.conf
– keybindings and general behaviorscope.sh
– file preview rulescommands.py
– custom commands in Python
Example: open PDFs with zathura
:
echo 'map zp shell zathura %f' >> ~/.config/ranger/rc.conf
Tips and Tricks #
- Press
z
theni
to toggle file previews. - Press
:bulkrename
to open selected files in$EDITOR
for batch renaming. - Use bookmarks: press
m
+ key to mark a directory,'
+ key to jump.
Integration with Other Tools #
- Use Ranger as the file picker in
vim
orneovim
by mapping it to a key. - Integrate with
lf
(another file manager),tmux
, or even your window manager.
Conclusion #
Ranger offers a powerful, keyboard-driven file management experience from your terminal. Once you get used to it, you may never want to go back to GUI file managers.
✨ Pro tip: Combine Ranger with
fd
,ripgrep
, orfzf
for a blazing-fast workflow.
Resources:
- 📘 Ranger GitHub
- 📄 Man Page
- 🎥 Demo Video