4Pane file manager – An optimal fit

In View

Article from Issue 168/2014
Author(s):

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.

Figure 1: When you first start, 4Pane provides a simple configuration 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.

Figure 2: In the standard configuration, the file manager shows two paired pane sets.

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.

Figure 3: 4Pane provides several possibilities for mounting external storage devices, which you can configure in detail to suit your needs.

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

01 diff -u %2f %4f
02 diff -u %Af %If
03 rsync -avu %3d/ %1d

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.

Figure 4: Integrate your own commands into the file manager.

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.

Figure 5: To use terminals with 4Pane, you need to define them beforehand.

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

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia