Introduction to Ranger
Ranger is a ncurses-based file manager that runs directly on the Linux terminal. Its design is inspired by vim philosophy, offering intuitive keyboard shortcuts and a real-time preview of files. Unlike traditional graphic scouts, Ranger allows you to navigate the file system without leaving the command line, which is ideal for system managers and developers who prefer to work in minimalist environments. In this article we will explore your installation, main features, configuration options and some tricks to make the most of it.
Installation in the most popular distributions
Ranger is available in the official repositories of most Linux distributions. In Ubuntu and derivatives just runsudo apt update && sudo apt install ranger. In Fedora is usedsudo dnf install rangerwhile in Arch Linux the command issudo pacman -S ranger. For users who prefer to compile from the source code, the official repository in GitHub provides aMakefilesimple and the required units are onlypython3andncurses. After installation, simply typerangerin any terminal to launch the application.
Interface and basic navigation
When you start Ranger, the screen is divided into three columns: the left column shows the father directory, the central current directory and the right a preview of the selected file. The navigation is done with the arrow keys or with the vim-like shortcutsh, j, kandl. PressEnteropens a file or enters a directory, whileBackspaceIt's back in the record. The preview allows you to inspect images, source code or PDF documents without opening an external application, provided that the corresponding application is installedpreview script.
Common operations with keyboard shortcuts
yycopy the current file or directory to the internal clipboard.pppaste the copied content in the current location.ddshort (short and copy) the selected item.delorxremoves the file, sending it to the bin if it is configured.!opens a command line to run any shell instruction directly from Ranger.Sallows to create a new empty file and open it immediately in the editor defined by the variable$EDITOR.Rrenombra the selected file or directory.
Preview and accessories
One of Ranger's most prominent features is its preview system, known aspreview script. By default, Ranger includes scripts to display text, code tuned, images (byw3morueberzug) and multimedia file metadata. To enable the preview of images in supporting terminals, installueberzugand add the lineset preview_images trueto configuration file~/.config/ranger/rc.conf. Customized scripts can also be created to preview any type of file, making Ranger a highly extensible tool.
Customization using rc.conf and scope.sh
Ranger's behavior is adjusted by two main files:rc.confandscope.sh. Inrc.confgeneral options such as the order of classification, the display of line numbers, the colors of the theme and the custom keyboard shortcuts are defined. For example,set sort naturalorders the files in a natural alphabetical form, whileset column_ratios 1,2,1adjust the width of the three columns. The filescope.shcontrol the preview scripts; editing it can be added or deleted file types that Ranger will try to preview. Both files are found in~/.config/ranger/and are automatically recharged when saving the changes.
Integration with development tools
Developers often combine Ranger with version managers like Git. Thanks to the commandgit statusintegrated into the preview, it is possible to see which files have been modified directly from the file browser. In addition, by pressingCtrl+xfollowed byCtrl+eopens the editor set up in$EDITORwith the current file ready to edit. Some users even map shortcuts to run unit tests or compile projects without leaving Ranger, using the command! makeor! pytestinside the internal command line.
Tips for improving productivity
- Use the full screen mode with
F11to maximize the space available when working on small monitors. - Save markers with
mfollowed by a letter and returns to them with'+ the same letter, which facilitates rapid access to frequent projects. - Activates diffuse search by installing plugin
ranger-fzfand assigned a shortcut as/to launchfzfon the current directory. - Synchronize Ranger's configuration between multiple machines through a dotfiles repository, ensuring that your favorite shortcuts and themes are always available.
- Combine Ranger with
tmuxorscreento divide the terminal and have a always visible command console while browsing the files.
Common problem solution
If Ranger does not show the preview of images, check that you have installedueberzugand that your terminal supports seisel graphics (such as xterm-256color or alacritty). In some environments of Wayland it may be necessary to usew3mforueberzug. Another common problem is that vim shortcuts do not work; this usually happens when the environment variableTERMis configured to a value that does not support color codes. Make sure you exportTERM=xterm-256colorbefore you launch Ranger. Finally, if the start is slow, check the number of active preview scripts inscope.shand disable those you don't need.
Comparison with other terminal file managers
Although Ranger is very popular, there are alternatives likelf, vifmandnnn. lfoffers a Go-based configuration and close integration withfzfwhilevifma more similar approach tovimwith divided screens.nnnit stands out for its low resource consumption and its ability to work with plugins through the shell environment. Ranger, however, combines a rich preview, a powerful command bar and an active community that continuously brings newpluginsandscope scripts. The choice will depend on your priorities: if you look for the best preview and extensibility, Ranger is usually the preferred option.
Conclusion
Ranger represents a powerful and light alternative to graphic file managers, especially for those living in the terminal. Your vim-like shortcut combination, real-time preview and high customization capacity makes it an indispensable tool for administrators, developers and any Linux user who seeks efficiency and total control over your file system. If you haven't tried it yet, install it today and find out how it can transform your daily workflow.


