Ranger: the terminal file manager that revolutionizes your workflow on Linux

Introduction to Ranger

Ranger is a ncurses‑based file manager that runs directly in the Linux terminal. Its design is inspired by the vim philosophy, offering intuitive keyboard shortcuts and a real‑time preview of files. Unlike traditional graphical explorers, Ranger lets you navigate the filesystem without leaving the command line, which is ideal for system administrators and developers who prefer working in minimalist environments. In this article we will explore its installation, main features, configuration options, and some tricks to get the most out of it.

Installation on the most popular distributions

Ranger is available in the official repositories of most Linux distributions. On Ubuntu and derivatives simply run sudo apt update && sudo apt install ranger. On Fedora use sudo dnf install ranger, while on Arch Linux the command is sudo pacman -S ranger. For users who prefer to compile from source, the official GitHub repository provides a simple Makefile and the required dependencies are only python3 and ncurses. After installation, just type ranger in any terminal to launch the application.

Interface and basic navigation

When starting Ranger, the screen is divided into three columns: the left column shows the parent directory, the middle column the current directory, and the right column a preview of the selected file. Navigation is done with the arrow keys or with the vim‑like shortcuts h, j, k and l. Pressing Enter opens a file or enters a directory, while Backspace goes back in the history. The preview lets you inspect images, source code or PDF documents without opening an external application, provided you have the corresponding preview script installed.

Common operations with keyboard shortcuts

  • yy copies the current file or directory to the internal clipboard.
  • pp pastes the copied content at the current location.
  • dd cuts (cut and copy) the selected item.
  • del or x deletes the file, sending it to the trash if configured.
  • ! opens a command line to execute any shell instruction directly from Ranger.
  • S allows you to create a new empty file and open it immediately in the editor defined by the variable $EDITOR.
  • R renames the selected file or directory.

Preview and add‑ons

One of Ranger’s most notable features is its preview system, known as preview script. By default, Ranger includes scripts for displaying text, syntax‑highlighted code, images (via w3m or ueberzug) and multimedia file metadata. To enable image preview in terminals that support it, just install ueberzug and add the line set preview_images true to the configuration file ~/.config/ranger/rc.conf. Likewise, you can create custom scripts to preview any file type, making Ranger a highly extensible tool.

Customization via rc.conf and scope.sh

Ranger’s behavior is adjusted through two main files: rc.conf and scope.sh. In rc.conf you define general options such as sort order, line number display, theme colors and custom keyboard shortcuts. For example, set sort natural sorts files in natural alphabetical order, while set column_ratios 1,2,1 adjusts the width of the three columns. The file scope.sh controls the preview scripts; editing it lets you add or remove file types that Ranger will attempt to preview. Both files reside in ~/.config/ranger/ and are automatically reloaded when you save changes.

Integration with development tools

Developers often combine Ranger with version‑control systems like Git. Thanks to the integrated git status command in the preview, you can see which files have been modified directly from the file browser. Moreover, pressing Ctrl+x followed by Ctrl+e opens the editor configured in $EDITOR with the current file ready for editing. Some users even map shortcuts to run unit tests or compile projects without leaving Ranger, using the command ! make or ! pytest inside the internal command line.

Tips to improve productivity

  • Use full‑screen mode with F11 to maximize available space when working on small monitors.
  • Save bookmarks with m followed by a letter and return to them with ' + the same letter, providing quick access to frequent projects.
  • Enable fuzzy search by installing the ranger-fzf plugin and assigning it a shortcut like / to launch fzf over the current directory.
  • Synchronize Ranger’s configuration across multiple machines via a dotfiles repository, ensuring your favorite shortcuts and themes are always available.
  • Combine Ranger with tmux or screen to split the terminal and keep a command console always visible while browsing files.

Troubleshooting common problems

If Ranger does not show image previews, verify that you have ueberzug installed and that your terminal supports sixel graphics (such as xterm‑256color or alacritty). In some Wayland environments you may need to use w3m instead of ueberzug. Another frequent issue is that vim shortcuts do not work; this usually happens when the TERM environment variable is set to a value that does not support color codes. Make sure to export TERM=xterm-256color before launching Ranger. Finally, if startup is slow, check the number of active preview scripts in scope.sh and deactivate those you don’t need.

Comparison with other terminal file managers

Although Ranger is very popular, there are alternatives such as lf, vifm and nnn. lf offers a Go‑based configuration and tight integration with fzf, while vifm follows a more vim-like approach with split panes. nnn stands out for its low resource consumption and ability to work with plugins via the shell environment. Ranger, however, combines a rich preview, a powerful command bar and an active community that continually contributes new plugins and scope scripts. The choice will depend on your priorities: if you seek the best preview and extensibility, Ranger is usually the preferred option.

Conclusion

Ranger represents a powerful and lightweight alternative to graphical file managers, especially for those who live in the terminal. Its combination of vim‑like shortcuts, real‑time preview and high customizability makes it an indispensable tool for administrators, developers and any Linux user seeking efficiency and total control over their filesystem. If you haven’t tried it yet, install it today and discover how it can transform your daily workflow.

This post is also available in ESPAÑOL.

Leave a Reply

Your email address will not be published. Required fields are marked *

Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional para Francesc Roig francesc@vivaldi.net .