$linuxjunkies
>

ranger(1)

A terminal file manager with VI key bindings and a column view showing file hierarchy and preview pane.

UbuntuDebianFedoraArch

Synopsis

ranger [OPTION]... [PATH]...

Description

Ranger is a console-based file manager with a minimalist design and powerful features. It displays a three-column view: directories on the left, current folder in the middle, and previews on the right. Navigate using VI-style keybindings (hjkl for movement) or arrow keys, and execute commands with a colon prompt similar to Vim.

The file manager is highly customizable through configuration files in ~/.config/ranger/. It supports image thumbnails, syntax-highlighted file previews, bookmarks, and custom commands. Ranger can open files with associated applications or run shell commands directly.

Common options

FlagWhat it does
--list-tagged-files FILEList all tagged files to FILE, one per line
--profilePrint execution time of ranger startup phases
--clear-cachesRemove cached directory information and exit
--copy-config TYPECopy default config files to ~/.config/ranger (TYPE: scope, rifle, rc, all)
--choosedir FILEExit with selected directory path written to FILE
--choosefile FILEExit with selected file path written to FILE
--cmd COMMANDExecute a ranger command before entering the interactive mode
--fail-unless-cdExit with error if directory cannot be entered
-rShow last directory using RANGER_PREVDIR environment variable

Examples

Start ranger in the current directory with default settings

ranger

Open ranger directly in the documents directory

ranger /home/user/documents

Use ranger to select a directory, then change to it in the current shell

ranger --choosedir /tmp/dir && cd "$(cat /tmp/dir)"

Copy all default configuration files to ~/.config/ranger/ for customization

ranger --copy-config all

Start ranger in /path with a search command already executing

ranger --cmd 'search filename' /path

Profile ranger startup performance to see initialization timing

ranger --profile 2>&1 | tail

Related commands