The Terminal Emulator and Command-line

Drag'n'Drop | The Display | Menu Sections

## The Terminal Emulator

If you do View > Show Terminal Emulator or Ctrl-M, a new area will appear near the bottom of the screen, between the panes and the statusbar. This is the Terminal Emulator, a place where you can type commands such as ls or df -h and have the result displayed. It also is where are displayed the results of Find, Grep and Locate (see Tools).
Just like a real console, the Terminal Emulator has a prompt. By default this will look something like: david@linux: /home/david $> (especially if you're called 'david'). However this can be configured at Options > Configure 4Pane > Terminals. Changes will take effect the next time the Terminal Emulator is opened.
On the right you will see three buttons with self-explanatory labels. The Cancel button does its best to interrupt a running command, but it doesn't always succeed. This can be a problem, as the Terminal Emulator isn't as fast as a real console; a command that displays hundreds of thousands of lines will take a long time to finish.
The Terminal Emulator has other disadvantages too:

- You can't create a root terminal with su or sudo bash. However you can run simple commands as the superuser with sudo e.g. sudo mkdir /mnt/foo or, for non-sudo distros, using su -c: su -c "mkdir /mnt/foo"
- It's not a real terminal emulator, so you can't use the official escape sequences
- You can't use most bash things e.g. variables, Ctrl-R.

However:

- It does support things like wildcards ('*' and '?'), pipes ('|') and redirection ('>' and '<').
- You can navigate through the command history with the Up and Down keys, or go to the first and last items with Ctrl-PageUp and Ctrl-PageDown.
- You can drag files from a pane into the Terminal Emulator. If the Ctrl key is being pressed, dragging 'foo' will write ./foo into the Terminal Emulator; if Ctrl-Shift, the full filepath; otherwise just the filename. You might find this convenient to add parameters to a command that you're constructing.

There is also an extra feature that I often find useful. If you use Locate or Find, in the results you'll have a list of files. You can:

- Double-click one of them. If it's an executable file, it will be run. Otherwise, if it's a filetype that 4Pane knows how to deal with (e.g. a .txt file) it will be opened, or else the Open With dialog will appear.
  If instead, while you double-click, you press the Ctrl key, instead of opening the file you will 'Go To' it: the current pane will display its directory, with the file itself selected.
- If you right-click over a file, a context menu will appear that contains those alternatives: Open or Go To.

The size of the Terminal Emulator can be adjusted by dragging its top border up or down. It can be closed by the same methods that open it, or by clicking its Close button.

## The Command-line

This is a single-line version of the Terminal Emulator. It is shown/hidden by View > Show Command-line or Ctrl-F6, and is positioned just below the toolbar.
You can use the Command-line in the same sort of way as the Terminal Emulator, but as it's only a single line, any output of a command is shown in the Terminal Emulator. So why not just use the Terminal Emulator in the first place? Good question. I've no idea why file-managers usually have both; but they do, so presumably someone likes them. If you want it, it's there.
If you run a command in the Terminal Emulator or Command-line, it's executed outside 4Pane; therefore the results can't be Undone and Redone. So don't experiment here with 'rm -f /' ;)