Back to Articles
Master Your Files from the Terminal with Ranger – The Ultimate CLI File Manager

Master Your Files from the Terminal with Ranger – The Ultimate CLI File Manager

fant0m

🐍 What is Ranger?

Ranger is a terminal-based file manager written in Python that uses ncurses to provide a clean, efficient, and keyboard-friendly interface for navigating your filesystem. It brings the power of a graphical file manager to your terminal, but with the speed and precision of Vim.

With its three-column layout, preview support, and custom commands, Ranger is a favorite among developers, sysadmins, and Linux power users.

⚡ Key Features

  • Vim-style keybindings: Efficient navigation and commands using familiar Vim keys (j, k, l, h, gg, /, etc.)
  • Previews: File previews for images, PDFs, text files, and more (using tools like w3m, ueberzug, or pdftotext)
  • Tabs and bookmarks: Quickly jump between directories and sessions
  • Custom commands: Create your own shell commands, macros, and keybindings
  • Integration: Easily open files with external editors or viewers like vim, mpv, sxiv, etc.
  • Extensibility: Customize with Python scripts and shell commands

🚀 Why Use Ranger?

If you spend a lot of time in the terminal and want a lightweight, powerful file manager, Ranger is your ideal tool. It combines the minimalism of the command line with the visual feedback and layout of a GUI. Whether you're managing servers, automating file operations, or just like fast workflows, Ranger gives you full control.

🛠️ Installation

Ranger is available in most Linux distributions and can be installed via:

sh
1sudo apt install ranger         # Debian/Ubuntu
2sudo pacman -S ranger           # Arch Linux
3brew install ranger             # macOS
4
5# Install with Pip
6pip install ranger-fm

📦 Basic Usage

Launch Ranger in your terminal:

sh
1ranger

Use the arrow keys or hjkl to navigate. Press:

  • Enter to open a file or directory
  • yy to copy a file path
  • dd to move
  • :q to quit
  • :help for full command list

🧩 Plugins & Preview Support

Enhance Ranger’s power using:

  • ueberzug or kitty for image previews
  • scope.sh for customizable file previewing
  • Integrate with file managers like fzf, ripgrep, or fd for powerful searching

🔧 Configuration

Ranger stores its configuration in ~/.config/ranger/. You can create a custom config using:

sh
1ranger --copy-config=all

Then edit:

  • rc.conf for keybindings
  • rifle.conf for application/file associations
  • scope.sh for preview customization

🧠 Pro Tips

  • Use :bulkrename to rename multiple files in your editor
  • Combine with tmux for a turbocharged terminal workspace
  • Use with fzf for fuzzy file finding directly in Ranger

🌟 Final Thoughts

Ranger offers a rare blend of usability, speed, and extensibility. If you're comfortable in the terminal and want to supercharge your file management, Ranger is worth mastering. With just a bit of configuration, it becomes an indispensable part of your Linux toolkit.