How to use Ranger for navigating files from the command line | Opensource.com
How to use Ranger for navigating files from the command line
Browse and preview files from the terminal with Ranger.
Ranger is an incredibly handy terminal-based file navigator that's written in Python and is available for Linux and Mac.
Ranger allows you to navigate your filesystem using the arrow keys on your keyboard: Up/Down to select files in the current directory (middle pane), and Left/Right to hop back and forth through levels and into directories. When you're focused on a directory, it shows you the contents in the right-hand pane:
When you're focused on any kind of text file, it shows you a preview of the contents in the pane:
I'd highly recommend Ranger to anyone who regularly uses the command line on a Raspberry Pi, Linux PC or server, or a Mac. Whether you're confined to SSH, prefer command-line access, or need to navigate around quicker than with the GUI, it's a great tool. No more cd, ls, cd, ls, cd .. tree, find, grep, etc.
To install it on Debian/Ubuntu systems:
sudo apt install ranger
Or on Mac:
brew install ranger
Then type ranger to begin.
The version in the current Ubuntu LTS (18.04) and current stable Debian/Raspbian (Stretch) is unfortunately dependent on Python 2.7, but it's been upgraded to Python 3, and that version can be found in Ubuntu (since 19.04 (Disco)) and Debian Buster. It's also on PyPI, so you can pip install ranger-fm (not ranger!) to install it.
This was originally published on Ben Nuttall's Tooling blog and is reused with permission.