For those working on Linux servers, having an efficient file management tool is indispensable. However, the traditional command line approach can easily become confusing and overwhelming. Today, I will introduce you to a powerful Linux server management tool: Ranger. It offers a smooth interface, easy-to-use shortcut keys, and many useful features that make managing files and directories easier.
ranger is a great tool that provides a multi-level view of your Linux files and allows you to browse and make changes using the arrow keys and some handy commands.
ranger is a unique and very convenient file system navigator that allows you to move within a Linux file system, enter and exit subdirectories, view text file contents, and even make modifications to files without leaving the tool.
It runs in a terminal window and allows you to navigate by pressing the arrow keys. It provides a multi-level file display, making it easy to see where you are, move around the file system, and select specific files.
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 getting started with the ranger is very simple.
ranger display method
One of the most important things you need to get used to right away 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 started the ranger. For example, if you start with your home directory, ranger will list all your home directories in the first column. The second column will show the first screen contents of directories and files in your home directory (or the directory you started in).
The key here is to look beyond any habits you might have and see the details shown in each row as relevant. All entries in the second column are related to a single entry in the first column, and the contents in the fourth column are related to the selected file or directory in the second column.
Unlike the normal command line view, directories will be listed first (in alphanumeric order) and files will be listed in second place (also in alphanumeric order). Starting from your home directory, the displayed content may look like this:
shs@dragonfly /home/shs/backups # files listing in selected in each of files in home directory selected directory
ranger The top line displayed tells you where you are. In this example, the current directory is /home/shs/backups. We see that empty is highlighted because there are no files in this directory. If we press the arrow keys to select bin, we will see a list of files:
shs@dragonfly /home/shs/bin 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 key to move deeper into a directory or view file contents.
If you continue to press the arrow keys to move to the files portion of the list, you will notice that the third column will show the file size (instead of the number of files). The "Current selection" row will also display the currently selected file name, while the rightmost column will display the file contents whenever possible.
shs@dragonfly /home/shs/busy_wait.c wait eel camper.jpg 5.55 M * it's used to show ASLR, and that's it nemo check_lockscreen 80 B */ shark chkrootkit-output 438 B #include ^ ^ ^ ^ | | | | homes files sizes file content
The bottom line of the display will display some detailed information about files and directories:
-rw-rw-r—- shs shs 338B 2019-01-05 14:44 1.52G, 365G free 67/488 11%
If you select a directory and press Enter, you will enter that 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's contents. You can then inspect the contents of the subdirectory and the contents of the file.
Press the left arrow key to move up one level.
Press the q key to exit ranger.
make change
You can press the ? 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 the c key and ranger will provide information on commands 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 a file is selected, you can enter :chmod 700 to set the permissions to rwx --.
Enter :edit to open the file in nano, allowing you to make changes, and then use nano's commands to save the file.
In short, Ranger is a very practical tool for people who manage files and directories on Linux servers. Its simple user interface and rich features make file management easy and enjoyable. If you are looking for an elegant and efficient way to manage files and directories on a Linux server, then Ranger is your ideal choice.
The above is the detailed content of Explore Linux server management artifact: Ranger. For more information, please follow other related articles on the PHP Chinese website!