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
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.