4Pane file manager – An optimal fit
In View
4Pane provides additional confidence in file management in the form of a clever undo function. Advanced users can install supplemental scripts in an instant.
A file manager's work is often very easy: move, copy, and delete files. However, from time to time, new contenders appear on the scene with a sophisticated set of additional functions that let users complete specialized tasks with a single mouse click. 4Pane belongs to this group [1].
Many distributions already have the latest version of 4Pane in their repositories, so you can usually install the tool easily via the package manager. For an installation from the source code, first set up the wxWidgets toolkit [2], then download the current 4Pane source code and compile it. The procedure is well documented online [3].
Assistance
The first time 4Pane starts, an assistant helps with the configuration (Figure 1). In principle, you do not need to adjust anything here. If you want to change anything later, however, the program provides a corresponding dialog.
The main window opens after the configuration step (Figure 2). You can immediately see where this file manager differs from others: Instead of the usual two panes, you'll see four areas comprising two pairs of panes. As with most aspects of the program, you can customize the pane layout.
This layout has several advantages: In many operations, it is not enough to see only a source and destination directory. A typical case might also involve editing files in subdirectories, such as copying fonts or other files grouped within a directory.
Additionally, 4Pane lets you keep multiple tabs open simultaneously and switch between them with one click. The Tabs menu contains functions for managing tabs.
To save a shortcut for the current path click on Bookmarks | Add to Bookmarks; 4Pane can manage up to 9,000 bookmarks, and you can access these saved bookmarks via the same menu.
Hands-On
The most important file functions are in the Edit menu and the context menu when right-clicking files or directories in the source or destination directory. As usual, Ctrl+C copies, Ctrl+X cuts, Ctrl+V pastes, and Ctrl+D duplicates selected files. Pressing F2 renames files and directories – even several at once, if necessary. Three different options let you delete files: Pressing Del moves files to the recycle bin, Shift+Del deletes the files but allows you to undo the action, and the preset Edit | Permanently Delete function, which is not mapped to a key combination, removes the data permanently.
The key combination Ctrl+Z lets you serially undo previous steps. Ctrl+Y will redo whatever was undone by the last Ctrl+Z. The Tabs | Save Layout as Template function (reached by right-clicking a tab or choosing it under the Tabs menu) saves the current tab setup as a template that can then be brought back by clicking Tabs | Load a Tab Template.
4Pane provides a direct access mode for containers, such as archives or distribution packages, as if they were normal directories. The Archive menu contains further functions for creating and editing such files.
As an additional function, the Mount menu helps you mount a variety of data sources. In addition to the partitions listed in /etc/fstab
, you can mount such things as ISO images of block devices (CDs/DVDs) and NFS or Samba shares. The corresponding dialog provides the most important mount options in a simple dialog (Figure 3). 4Pane generates icons in the toolbar for quick access to mounted devices.
The Tools menu offers two methods to find files by name: Locate and Find. Find offers more functions, with tabs for dialogs that build a search string. At the bottom of each tab, the Add To Command String button adds the chosen options to the command line for running later on. This command is very sensitive to the correct option order, so it is vital that you use the tabs in the order presented in the dialog.
The Grep option has two variants: a Quick Grep and Full Grep. Both dialogs allow you to sift through the files of the current directory for a specified pattern. Pressing F1 offers help for many procedures and controls.
Your Own Commands
You can retroactively install special commands or procedures not offered by the file manager with your own shell scripts, or those provided by 4Pane, by passing in the selected files or directories using the strings summarized in Table 1.
Table 1
Format Strings
String | Function |
---|---|
%s |
Current file or directory |
%f |
Selected file |
%d |
Selected directory |
%a |
All selected items in the current pane |
%b |
Selected item in both file views |
%p |
Prompts for the parameter you want to use |
%1s |
File or directory in the left (top) directory view |
%2s |
File or directory in the left (top) file view |
%3s |
File or directory in the right (bottom) directory view |
%4s |
File or directory in the right (bottom) file view |
%As |
File or directory in the active pane |
%Is |
File or directory in the inactive pane |
Some examples from the documentation explain the use. For example, line 1 in Listing 1 compares the left (%2f
) and the right (%4f
) panes. Line 2 does the same thing for the active and inactive panes. You can update the active directory in the left pane from that selected in the right via the command in line 3. It is also possible to implement tools with administrative privileges because 4Pane supports actions with sudo
.
Listing 1
Sample Scripts
To find scripts, either choose Tools | Run a Program or use the context menu. New commands can be defined via Options | Configure 4Pane under the Tools | Add a tool section (Figure 4). This section also lets you assign a label that appears as text in the Tools menu, and if you prefer, you can group items in a Tools submenu.
4Pane allows you to run commands as root, which the correspondingly named checkbox enables. Internally, the program uses a previously installed sudo by default. Other variants are also possible: If you want to use this option, check out the Configure 4Pane | Miscellaneous | Superuser section.
If the program or script needs to run in a terminal, enable the Run in a Terminal checkbox. To see the output of a command, click Keep terminal open to keep it from closing automatically.
The next thing you need to do is set up a terminal for this purpose (Figure 5). The third line in this dialog is crucial for self-defined commands. The terminal can be left open permanently via the -hold
option.
If you want to see the output from a command but do not want to close the terminal manually every time, then you can add ; sleep 2
to the command line. After the command is finished, the shell will then wait two seconds before the terminal closes. If a command or script affects the content of any of the panes (e.g., you are creating new files), make sure the program regenerates its content via Edit | Refresh the Display (F5).
To modify existing commands – the developer specifies some as examples – you can use Options | Configure 4Pane | Tools | Edit a tool; to delete the commands, use Delete a tool.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.