← 返回命令列表

Linux command

ranger 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start ranger

ranger

Start ranger

ranger [path/to/directory]

Show hidden files

ranger --show-hidden

Generate default configuration files

ranger --copy-config=all

Print the selected files

ranger --choosefile=[target_file]

说明

ranger is a console-based file manager with Vi-style keybindings. It features a three-column layout showing the parent directory, current directory, and file preview simultaneously. The interface provides instant navigation using hjkl keys (or arrow keys): h moves to the parent directory, j/k moves up/down in the file list, and l opens directories or files. Additional Vim-like commands include gg for top of list, G for bottom, and / for search. File operations follow Vim patterns: yy yanks (copies), dd cuts, pp pastes, dD deletes. Rename with cw, create directories with :mkdir, and open files with r to select an application. Ranger includes rifle, a file opener that automatically selects appropriate applications based on file type. It supports image previews (with appropriate terminal support), syntax-highlighted text previews, and archive content viewing.

参数

--copy-config=_which_
Copy default configuration files to ~/.config/ranger (rc, scope, rifle, commands, or all)
--choosefile=_target_
Write selected file path to target file on exit (for shell integration)
--choosedir=_target_
Write last visited directory to target file on exit
--show-hidden
Show hidden files by default
--cmd=_command_
Execute ranger command after startup
--version
Display version information
--help
Display help information

FAQ

What is the ranger command used for?

ranger is a console-based file manager with Vi-style keybindings. It features a three-column layout showing the parent directory, current directory, and file preview simultaneously. The interface provides instant navigation using hjkl keys (or arrow keys): h moves to the parent directory, j/k moves up/down in the file list, and l opens directories or files. Additional Vim-like commands include gg for top of list, G for bottom, and / for search. File operations follow Vim patterns: yy yanks (copies), dd cuts, pp pastes, dD deletes. Rename with cw, create directories with :mkdir, and open files with r to select an application. Ranger includes rifle, a file opener that automatically selects appropriate applications based on file type. It supports image previews (with appropriate terminal support), syntax-highlighted text previews, and archive content viewing.

How do I run a basic ranger example?

Run `ranger` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --copy-config=_which_ do in ranger?

Copy default configuration files to ~/.config/ranger (rc, scope, rifle, commands, or all)