How to Install and Use Ranger on Ubuntu 24.04
Welcome back to the Greenhost.cloud blog! Today, we’re diving into the world of file management on the command line by exploring Ranger, a powerful and user-friendly terminal-based file manager for Linux. It’s a great tool for users who prefer working in the terminal but still want a visual way to navigate their files. In this post, we’ll walk you through the steps required to install Ranger on Ubuntu 24.04 and provide some tips on how to use it effectively.
What is Ranger?
Ranger is a text-based file manager for Unix-like systems that utilizes a minimalistic and intuitive interface. It allows users to navigate their filesystem efficiently using keyboard shortcuts, while also providing a preview of files and directories. Ranger is built on Python and is highly customizable, making it a favorite among developers and power users.
Prerequisites
Before we begin, ensure that you have the following:
- An Ubuntu 24.04 system
- Access to a terminal with sudo privileges
Step 1: Update Your System
First, it’s always a good idea to update your package lists to ensure you have the latest software versions. Open your terminal and run:
sudo apt update
sudo apt upgrade
Step 2: Install Ranger
You can easily install Ranger using the default package manager, apt
. To do so, run the following command:
sudo apt install ranger
This command will download and install Ranger along with any necessary dependencies. Once the installation is complete, you can start using Ranger immediately.
Step 3: Launch Ranger
To launch Ranger, simply type the following command in your terminal:
ranger
You will be greeted with the Ranger interface, showcasing the contents of your current directory.
Step 4: Basic Navigation
Navigating through Ranger is intuitive and relies on keyboard shortcuts:
- Arrow Keys: Move up and down through files and directories.
- Enter: Open a selected file or directory.
- Backspace: Go up to the parent directory.
- h: Go to the previous directory.
- l: Go to the next directory or open a file.
- gg: Go to the top of the list.
- G: Go to the bottom of the list.
Step 5: File Operations
Ranger allows you to perform various file operations directly from the interface:
- Copy: Select a file and press
yy
to copy it. - Move: Press
dd
to cut (move) a file. - Paste: Navigate to the desired directory and press
pp
to paste. - Delete: Select a file and press
dd
twice to delete it. - Rename: Select a file and press
cw
to rename it.
Step 6: Customization
Ranger is highly customizable. You can modify its configuration files to adjust keybindings, colors, and other settings. The configuration file is located in the ~/.config/ranger/
directory. To create a configuration file, run:
ranger --copy-config=all
This command creates a set of configuration files you can modify to suit your preferences.
Step 7: Using Ranger with Plugins
Ranger supports various plugins that can enhance its functionality. For example, you might want to use the ranger-fzf plugin for fuzzy searching. To install it, follow these steps:
- Clone the ranger-fzf repository:
git clone https://github.com/junegunn/fzf.git ~/.fzf
- Run the installation script:
~/.fzf/install
- Now, you can integrate it with Ranger by adding custom keybindings in your
rc.conf
file located in~/.config/ranger/
.
Conclusion
Ranger is an excellent tool for those who prefer using the terminal for file management. Its intuitive interface, combined with powerful features and customization options, makes it a go-to choice for many Linux users. Now that you know how to install and use Ranger on Ubuntu 24.04, we encourage you to explore its many features and make it a part of your daily workflow.
For more tutorials and insights into the world of cloud and server management, be sure to check out our other posts at Greenhost.cloud!