Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Linux File system Navigator ranger

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the Linux file system navigator ranger. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Ranger is a convenient file system navigator in Linux system, which can move files, enter and exit subdirectories, view file contents, and so on.

To install ranger, use standard installation commands (for example, sudo apt install ranger). To start it, just type ranger. It has a long, very detailed manual page, but it's easy to get started with ranger.

The display mode of ranger

The most important thing you need to get used to right now is the way ranger files are displayed. Once you start ranger, you will see four columns of data. The first column is one level above where you start ranger. For example, if you start with home directories, ranger will list all home directories in the first column. The second column will display the first screen contents of the directories and files in your home directory (or the directory where you started).

The key here is to go beyond any habits you may have and treat the details shown in each line as relevant. All entries in the second column are related to a single entry in the first column, and the content in the fourth column is related to the file or directory selected in the second column.

Unlike the normal command line view, directories will be listed first (in alphabetical order) and files will be listed in second place (also alphanumeric). Starting with your home directory, the display might look like this:

Shs@dragonfly / home/shs/backups current selection

Bugfarm backups 0 empty

Dory bin 59

Eel Buttons 15

Nemo Desktop 0

Shark Documents 0

Shs Downloads 1

^ ^

| | |

Homes directories # files listing

In selected in each of files in

Home directory selected directory

The top line of the ranger shows you where it is. In this example, the current directory is / home/shs/backups. We see empty highlighted because there are no files in this directory. If we press the arrow key below to select bin, we will see a list of files:

Shs@dragonfly / home/shs/bin current selection

Bugfarm backups 0 append

Dory bin 59 calcPower

Eel Buttons 15 cap

Nemo Desktop 0 extract

Shark Documents 0 finddups

Shs Downloads 1 fix

^ ^

| | |

Homes directories # files listing

In selected in each of files in

Home directory selected directory

The highlighted entry in each column shows the current selection. Use the right arrow keys to move to a deeper directory or view the contents of the file.

If you continue to press the arrow keys to move to the file section of the list, you will notice that the third column will show the file size (not the number of files). The current selection line also displays the currently selected file name, while the rightmost column displays the contents of the file as much as possible.

Shs@dragonfly / home/shs/busy_wait.c current selection

Bugfarm BushyRidge.zip 170K / *

Dory busy_wait.c 338 B * program that does a busy wait

Eel camper.jpg 5.55m * it's used to show ASLR, and that's it

Nemo check_lockscreen 80 B * /

Shark chkrootkit-output 438B # include stdio.h >

^ ^

| | |

Homes files sizes file content

Some file and directory details are displayed at the bottom line of the display:

-rw-rw-r-- shs shs 338B 2019-01-05 14:44 1.52G, 365G free 67 Universe 488 11%

If you select a directory and press enter, you will enter the directory. Then, the leftmost column in your display will be a list of the contents of your home directory, and the second column will be a list of files in that directory. Then you can check the contents of the subdirectory and the contents of the file.

Press the left arrow key to move up one level.

Press Q to exit ranger.

Make a change

Can you press it? Key to pop up a help line at the bottom of the screen. It should look like this:

View [m] an page, [k] ey bindings, [c] commands or [s] ettings? (press q to abort)

Press c and ranger will provide you with command information that you can use within the tool. For example, you can change the permissions of the current file by typing: chmod, followed by the expected permissions. For example, once you have selected a file, you can enter: chmod 700 to set permissions to rwx-.

Input: edit can open the file in nano, allowing you to modify it, and then use the nano command to save the file.

This is the end of this article on "how to use ranger, a Linux file system navigator". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report