Open-source News

Manage your files in your Linux terminal with ranger

opensource.com - Mon, 07/04/2022 - 15:00
Manage your files in your Linux terminal with ranger Sumantro Mukherjee Mon, 07/04/2022 - 03:00 Register or Login to like Register or Login to like

The most basic way to look at your files and folders is to use the commands ls and ll. But sometimes, I want to see not just the file metadata but also the contents of a file at a glance. For that, I use ranger.

If you love working out of your console and using Vim or Vi, and you don’t want to leave your terminal for any reason, ranger is your new best friend. Ranger is a minimal file manager that allows you not only to navigate through the files but also to preview them. Ranger comes bundled with rifle, a file executor that can efficiently choose programs that work with a given file type.

Installing ranger on Linux

Ranger can be installed in Fedora or any RPM-based distro by running

$ sudo dnf install ranger

Ranger is also available for other distros and macOS.

Using ranger for the first time

As a user, you can start ranger by simply typing $ ranger on your favorite terminal. The arrow keys give way to the navigation. This screenshot is an excellent example of how I can preview the code of the config.example file stored in Kernel-tests.

Image by:

(Sumantro Mukherjee, CC BY-SA 4.0)

Picking any file and hitting F4 opens up your default editor and lets you edit the files right away!

What about images and videos?

Using rifle with ranger lets you quickly find the program associated with a given file. Hovering over an image and then trying to open it is very simple; just hit Enter. Here’s how that looks:

Image by:

(Sumantro Mukherjee, CC BY-SA 4.0)

Hitting i on an image file will give the user all the EXIF data. Hitting Shift+Enter will open the PDF file.

Image by:

(Sumantro Mukherjee, CC BY-SA 4.0)

The same key combo will open and start playing videos in the system's default video player that supports the codec. The example below is an mp4 video, which plays just fine on VLC.

Image by:

(Sumantro Mukherjee, CC BY-SA 4.0)

More Linux resources Linux commands cheat sheet Advanced Linux commands cheat sheet Free online course: RHEL technical overview Linux networking cheat sheet SELinux cheat sheet Linux common commands cheat sheet What are Linux containers? Our latest Linux articles File ops

The following key bindings work well unless otherwise configured by the Vim user.

j: Move down
k: Move up
h: Move to parent directory
gg: Go to the top of the list
i: Preview file
r: Open file
zh: View hidden files
cw: Rename current file
yy: Yank (copy) file
dd: Cut file
pp: Paste file
u: Undo
z: Change settings
dD: Delete file

Console commands

Sometimes I have a folder that contains screenshots of a particular software when I am drafting articles. Selecting or marking files by hitting Space and then typing :bulkrename helps me move all the weird timestamps to, for example, lorax1, lorax2 , and so on. An example is below:

Image by:

(Sumantro Mukherjee, CC BY-SA 4.0)

Other useful console commands include:

:openwith: Open a select file with a program of your choice
:touch FILENAME: Create a file
:mkdir FILENAME: Create a directory
:shell : Run a command in shell
:delete: Delete files

Will it work in tty2/3/4?

As someone who works in quality assurance (QA), I've found that searching for logs and reading them has never been easier. Even when my Gnome Display Manager crashes, I can switch over to my tty2, log in with my username and password, and start ranger with superuser permission, and then I am all sorted to explore!

Ranger is a great tool for working with files without ever having to leave the terminal. Ranger is minimal and customizable, so give it go!

Try this lightweight open source tool to preview files without leaving the terminal.

Linux What to read next How I use the attr command with my Linux filesystem This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.

How to Install WordPress with LAMP on SUSE Linux Enterprise

Tecmint - Mon, 07/04/2022 - 13:31
The post How to Install WordPress with LAMP on SUSE Linux Enterprise first appeared on Tecmint: Linux Howtos, Tutorials & Guides .

Written in PHP, WordPress is one of the most popular and widely used CMS (Content Management Systems). It is free and open-source and is used for creating stunning websites by providing prebuilt feature-rich templates

The post How to Install WordPress with LAMP on SUSE Linux Enterprise first appeared on Tecmint: Linux Howtos, Tutorials & Guides.

Linux 5.19-rc5 Released - "Slightly Smaller Than Normal"

Phoronix - Mon, 07/04/2022 - 07:06
A week ago with Linux 5.19-rc4 there was concern over that weekly release being larger than normal, but this week with Linux 5.19-rc5 it's smaller than normal, which is pleasing Linux creator Linus Torvalds...

AMD Gets Back To Working On Their "Jadeite" Platform For Linux In 2022

Phoronix - Sun, 07/03/2022 - 21:05
Somewhat surprisingly, AMD engineers have been working on some new Linux kernel patches for their aging Jadeite platform...

When Time Comes For GTK5, It Might Be Wayland-Only On Linux

Phoronix - Sun, 07/03/2022 - 18:48
While GTK4 is still in its early stages and it will presumably be some years before "GTK5" even begins to take shape, GNOME developers are already thinking of ditching X11 support for that next major GTK release -- effectively making it Wayland-only on Linux...

Intel Media Driver 2022Q2 Adds HDR10/HVS Support For DG2, Raptor Lake P Enabling

Phoronix - Sun, 07/03/2022 - 17:22
In addition to Intel this week releasing the VA-API 2.15 video acceleration library, their open-source engineers also published their newest quarterly feature release of their open-source Intel Media Driver that implements the VA-API interface for their graphics hardware...

Pages