Midnight Commander (en)

Aus Gemini-Wiki
Zur Navigation springen Zur Suche springen
Deutsch.png - in Deutsch English.png - in English
Midnight Commander

GNU Midnight Commander, known as mc, is a free clone of the DOS Tool Norton Commander (→two panels) and is one of the most famous console programs for Linux. Over a VFS it's also possible to access archives ans network servers easily.

For Linux beginners, if you have used a similar tool under DOS, Windows or OS/2, it helps with many tasks. The biggest advantage is the versatility: mouse support (GPM), integrated FTP Client, unpack different types of archives and packages (of course the programs need to be installed before) tar.gz, bzip, zip, rar, rpm, deb, ... . And yes, many operations are faster in the console using commands. But with mc it's easier, e.g. copying, deleting, ... of files which can be difficult to filter. And last but not least, the integrated editor with syntax support (for almost any language) and simple interface is a big help for new users (which might think vi is a French cheese).

As it is a console program with function keys, many operations will be performed quickly after a short learning period. Much faster as from the console with commands or with a GUI. mc is much better as GUI file managers, especially regarding speed.

The Midnight Commander on the Dreambox can be "stripped" and might have limited functions available. It's recommended to learn this tool to perform quickly many tasks without installing any software on a PC before.

Start Midnight Commander

Connect via Telnet or SSH with the Dreambox and enter following command in the console (Terminal):

mc

The Midnight Commander will be started, and looks like the image in this article...

Create or edit text files

Create file

To create a new text file or to open and edit an existing file, use the command "mcedit file_name" an example:

mcedit nas-feed.conf

now you can write your text and save the file

src/gz nas-feed http://ip_of_Webserver/dreambox

Important shortcuts

Shortcut / combination Action
F1 .. F10 see menu bar at the lower screen border

It's also possible to use the functions by pressing ESC+1...0.

Tab Switch the active panel
Ctrl+o Hide the panel, to see the normal screen
Ctrl+x i Info mode in the other panel
Ctrl+x q Quick view in the other panel
Ctrl+s / Alt+s Name search in the actual panel
Esc+p previous command
Esc+↵ Enter copy the actual file name on the console
Esc+Tab Complete the command (apply twice sometimes)
Alt+o Sync panels (other panel sets the same path!)
Alt+c Change in a specified directory
Alt+Tab Shell extensions (not under X)
Alt+? File search
Alt+t (toggle) Switch different displays
+ / - select / unselect (pattern matching)
Insert Select/deselect single File/Directory
+ * ↵ Enter Select all files/directories
- * ↵ Enter Deselect all files/directories

Tips & Tricks

Settings:

  • If you don't like vi, activate the internal editor over "Options / Configuration / Use internal edit".
  • Lynx movements mean: use the cursor buttons to enter / leave a directory.

SCP Client:

A SCP access is possible with following command. Use the command cd to close the connection.

cd sh://username@domain.de/path

Alternatively you can use the drop down menu [Left/Right] → [Shell Link] to connect. The syntax is like this:

username@domain.de

FTP Client:

With the following command Midnight Commander can connect with a FTP Server. Of course, Midnight Commander must be started before. Use the command cd to close the connection.

cd ftp://domain.de

A password secured FTP Server can be reached as follows. Use the command cd to close the connection.

cd ftp://username@domain.de

If Midnight Commander is closed, the FTP connection can be started as follows.

mc ftp://username@domain.de

Alternatively you can use the drop down menu [Left/Right] → [FTP Link]. the syntax is like this:

username@domain.de

Look / Mouse support since OE 2.0

A better look, incl. mouse support, can be activated in a OE 2.0 / OE 2.2 / OE 2.5 image with following commands.

echo "TERM=xterm" >> ~/.profile
 
source ~/.profile

Weblinks