Master Ranger: The Powerful Terminal File Manager for Linux
This guide explains how to install, configure, and use the lightweight, Vim‑integrated terminal file manager Ranger on Linux, covering its three‑pane layout, essential commands, preview capabilities for files, images, and PDFs, as well as customization through its configuration files.
What is Ranger
Ranger is a lightweight, Vim‑integrated terminal file manager for Linux. It displays a three‑column view: left column shows the parent directory, middle column the current directory contents, and right column a preview of the selected file or folder.
Installation
Ranger requires make, git and vim. Install them first, then install ranger from the distribution’s package manager. sudo apt install make git vim Debian/Ubuntu: sudo apt install ranger CentOS/Fedora/RHEL:
sudo yum install rangerBasic usage
Start ranger: ranger Navigation keys (Vim‑style):
Page Up ctrl +b / u
Page Down ctrl + f / d
Top line gg
Bottom line G
Forward L
Back H
Parent dir h
Child dir l
Find f
Search /
Next n
Previous N
File‑management shortcuts:
New file/dir :touch xxx Delete d D
Change permissions cw /I /A
Copy yy
Paste pp
Cut dd
Refresh R
Press Enter to open a file and q to quit.
Configuration files
Generate the default configuration in ~/.config/ranger: ranger --copy-config=all The directory contains:
commands.py – defines console commands
rifle.py – maps file types to external programs
rc.conf – key bindings and settings
scope.sh – preview handling script
File preview
Ranger can preview many text formats (.txt, .py, .docx, .epub, .pdf) as well as images and videos. The scope.sh script selects the external program for each type.
Image preview
Terminals that support inline images (e.g., urxvt, iTerm2, Kitty, Terminology) can show image previews when the option preview_images_method = true is set in rc.conf. Other terminals such as MobaXterm or Xshell open a separate window.
PDF preview
By default ranger converts PDFs to images. To display PDFs directly, edit scope.sh and uncomment the PDF‑preview section. After saving, PDFs render in supported terminals.
Console commands
Enter commands at the bottom prompt by typing :. Useful commands include: :bulkrename – batch rename files :openwith – open the selected file with a chosen program :touch <filename> – create a new file :mkdir <dirname> – create a new directory :shell <command> – run a shell command :delete – delete files
Placeholders can be used in commands: %F – highlighted file %d – current directory %s – currently selected file %t – marked file(s)
Example: :delete %s deletes the selected file.
Options modify :shell behavior: -w – display command output (e.g., :shell -w free) -t – run in a new terminal window (e.g., :shell -t nano) -f – fork a GUI program (e.g., :shell -f firefox) r – run with root privileges
Reference
Official repository:
https://github.com/ranger/rangerSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
