Difference between revisions of "Midnight Commander"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (Why don't line drawing characters work?)
(Another PPC Release...)
 
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Articles|LS1|LS2|HG|FreeLink|OpenLink|software}}
+
{{Articles|LS1|LS2|HG|FreeLink|OpenLink|software|ipkg}}
{{Warning|This is a work in progress, all of the content of this article has not been verified to work, use it at your own risk}}
+
<table align=right><tr><td>http://upload.wikimedia.org/wikipedia/cs/thumb/2/2e/Mc-screenshot.png/400px-Mc-screenshot.png </td></tr></table>
<table align=right><tr><td>http://upload.wikimedia.org/wikipedia/en/thumb/7/79/Midnight-commander.png/250px-Midnight-commander.png </td></tr></table>
+
 
=Background=
 
=Background=
 
'''[[w:Midnight Commander|Midnight Commander]]'''<ref>Wikipedia: [[w:Midnight Commander|Midnight Commander]]</ref> (mc)<ref>[http://www.ibiblio.org/mc/ The official site of GNU Midnight Commander]</ref> is an [[w:orthodox file manager|orthodox file manager]] for [[w:Unix-like|Unix-like]] systems (also works in [[w:Microsoft Windows|Windows]]) and a [[w:clone (computer science)|clone]] of [[w:Norton Commander|Norton Commander]].
 
'''[[w:Midnight Commander|Midnight Commander]]'''<ref>Wikipedia: [[w:Midnight Commander|Midnight Commander]]</ref> (mc)<ref>[http://www.ibiblio.org/mc/ The official site of GNU Midnight Commander]</ref> is an [[w:orthodox file manager|orthodox file manager]] for [[w:Unix-like|Unix-like]] systems (also works in [[w:Microsoft Windows|Windows]]) and a [[w:clone (computer science)|clone]] of [[w:Norton Commander|Norton Commander]].
Line 15: Line 14:
 
It is very popular on Linux due to being based on versatile text interfaces, such as [[w:Ncurses|Ncurses]] or [[w:S-Lang|S-Lang]], which allow it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.
 
It is very popular on Linux due to being based on versatile text interfaces, such as [[w:Ncurses|Ncurses]] or [[w:S-Lang|S-Lang]], which allow it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.
 
=Installation=
 
=Installation=
==Binary Only==
+
{{Warning|This is a work in progress, all of the content of this article has not been verified to work, use it at your own risk}}
 +
==Raw Binaries==
 
===PowerPC===
 
===PowerPC===
Install the raw binary only<ref>[http://forum.linkstationwiki.net/index.php?action=vthread&forum=13&topic=1352&page=0 The Linkstation Community Forum / Terastation (ppc) / How to install Midnight Commander ?]</ref>
+
Compiled by casaschi and packaged by izzy - forces use of characters +, |, - for line drawing. If you want to save space (about 1M), copy only the files from <tt>bin/</tt> to <tt>/bin</tt>. The stuff from <tt>usr/</tt> is only needed for syntax-highlightning, VFS support (browse tar/zip/... files like directories) and online help<ref>[http://forum.nas-central.org/index.php?action=vthread&forum=13&topic=1352&page=0 The NAS-Central Community Forum / Terastation (ppc) / How to install Midnight Commander ?]</ref>
  wget http://www.unet.univie.ac.at/~a0025690/ppc-binaries/mc_ppc261.tgz  
+
  wget http://downloads.nas-central.org/mirrors/linkstationbinaries.webhop.net/ppc/mc_ppc261.tgz
 
  tar -C / -xzvf mc_ppc261.tgz
 
  tar -C / -xzvf mc_ppc261.tgz
 
Midnight Commander should be available by executing
 
Midnight Commander should be available by executing
 
  mc
 
  mc
 +
despite the filename, this is version 4.6.1 of Midnight Commander
 +
 +
 +
===Another PPC Release...===
 +
Midnight Commander for the Terastation and Linkstation : Porting and packaging of Midnight Commander 4.6. Versions available for users of the the Buffalo Linkstation with Motorola PowerPC core (HD-HLAN PowerPC [LS1]) and the Tera Station (HD-HTGL + HS-HTGL ppc [TS]).
 +
 +
An alternative, totally unsupported tarball for Midnight Commander 4.61 can be found [http://sourceforge.net/projects/midnightbuffalo/ here]. It is kinda big because all of the supporting libraries are in the archive. If you already have glib and libgpm on your terastation or LS, you can do without the /usr/lib directory.
 +
 +
This build of MC4.61 works pretty good with the OpenTera firmware update which can be found [http://homepage.ntlworld.com/itimpi/buffalo.htm#OPENTERA here]. It was derived from the MC4.61 distributed in Debian PPC distros.
 +
 +
In short, I ripped it off from a FreeLink install on my LS120.
 +
 +
[[User:Rootoftheproblem|Rootoftheproblem]] 20:24, 13 December 2007 (CST)
 +
 +
===LSPro/Live (Stock)===
 +
Compiled by Kaiten. glib is not included in the stock firmwares. It is available below.
 +
wget http://downloads.nas-central.org/Users/kaiten/mc-4.6.1_arm9.tgz
 +
wget http://downloads.nas-central.org/Users/kaiten/glib-2.12.12_arm9.tgz
 +
tar -C / -xzvf mc-4.6.1_arm9.tgz
 +
tar -C / -xzvf glib-2.12.12_arm9.tgz
 +
ldconfig -v
 +
Midnight Commander should be available by executing
 +
mc
 +
Report issues here <ref>[http://forum.nas-central.org/viewtopic.php?f=39&t=3620&hilit= The NAS-Central Community Forum / LS Pro/Live / Midnight Commander ?]</ref>
 +
 
==FreeLink==
 
==FreeLink==
Use apt-get to install Midnight Commander
+
Use [[w:Advanced Packaging Tool| apt-get]] to install Midnight Commander
 
  apt-get install mc
 
  apt-get install mc
 
==OpenLink==
 
==OpenLink==
Line 34: Line 59:
 
*[[Ipkg on the Linkstation (for end-users)]]
 
*[[Ipkg on the Linkstation (for end-users)]]
 
*[[Ipkg on the Linkstation (for end-users)#MIPSel 2|Experimental "unstable" ipk Packages for the MIPSEL Linkstation]]
 
*[[Ipkg on the Linkstation (for end-users)#MIPSel 2|Experimental "unstable" ipk Packages for the MIPSEL Linkstation]]
*Install Midnight Commander<ref>[http://forum.linkstationwiki.net/index.php?action=vthread&forum=3&topic=170&page=0 The Linkstation Community Forum / Linkstation 2 (mips) / midnight commander (or similar) on LS?]</ref><ref>[http://forum.linkstationwiki.net/index.php?action=vthread&forum=3&topic=1304 The Linkstation Community Forum / Linkstation 2 (mips) / Search for Midnight Commander LS2]</ref>
+
*Install Midnight Commander<ref>[http://forum.nas-central.org/index.php?action=vthread&forum=3&topic=170&page=0 The NAS-Central Community Forum / Linkstation 2 (mips) / midnight commander (or similar) on LS?]</ref><ref>[http://forum.nas-central.org/index.php?action=vthread&forum=3&topic=1304 The NAS-Central Community Forum / Linkstation 2 (mips) / Search for Midnight Commander LS2]</ref>
 
  ipkg install mc
 
  ipkg install mc
 +
'''Attention:'''
 +
installing MC by using ipkg will download and install version 2.3.2 of libc6 - overwriting in a process libpthread-0.10.so with older version
  
 
=Why don't line drawing characters work?=
 
=Why don't line drawing characters work?=
Since version 4.0.13 there's the command line option -a to force use of charaters +, |, - for line drawing (only available when compiled with S-Lang).  Use the -a option if any of the suggestions below doesn't help.<ref>[http://www.ibiblio.org/mc/FAQ GNU Midnight Commander: Frequently Asked Questions]</ref>
+
Since version 4.0.13 there's the command line option -a to force use of characters +, |, - for line drawing (only available when compiled with S-Lang).  Use the -a option if any of the suggestions below doesn't help.<ref>[http://www.ibiblio.org/mc/FAQ GNU Midnight Commander: Frequently Asked Questions]</ref>
  
In general, there are three cases:
+
'''In general, there are three cases:'''
 
* Lines are shown as ASCII characters like this
 
* Lines are shown as ASCII characters like this
 
  +---------+
 
  +---------+
 
  |        |
 
  |        |
 
  +---------+
 
  +---------+
This also happens when you use the -a option.  Other than that possible reason is 1 or 2 (see below).
+
:This also happens when you use the -a option.  Other than that possible reason is 1 or 2 (see below).
 
* Lines are shown as lower case characters like this
 
* Lines are shown as lower case characters like this
 
  lqqqqqqqqqk
 
  lqqqqqqqqqk
 
  x        x
 
  x        x
 
  mqqqqqqqqqj
 
  mqqqqqqqqqj
Possible reason is 1 or 2 (see below).
+
:Possible reason is 1 or 2 (see below).
 
* Lines are shown as blanks or missing characters.  Possible reason is 2 or 3 (see below).
 
* Lines are shown as blanks or missing characters.  Possible reason is 2 or 3 (see below).
The reason for the problem is one of following:
+
 
 +
'''The reason for the problem is one of following:'''
 
#Your terminal might not support line drawing characters.  VT100 compatible terminals, rxvt and xterm and color_xterm do support them.
 
#Your terminal might not support line drawing characters.  VT100 compatible terminals, rxvt and xterm and color_xterm do support them.
 
#Your terminfo or termcap database might have missing or incorrect definitions for line drawing characters.  Set the acsc variable in the terminfo database like this: '''<tt><nowiki>acsc=a\376k\277l\332m\300j\331n\305w\302v\301u\264t\303q\304x\263h\2600\333 </nowiki></tt>''' Don't forget issue 'tic' command.  This supposes you are using PC character set.  The octal values might be different for other character sets.  If you are using termcap instead of terminfo, you should modify above solution appropriately.
 
#Your terminfo or termcap database might have missing or incorrect definitions for line drawing characters.  Set the acsc variable in the terminfo database like this: '''<tt><nowiki>acsc=a\376k\277l\332m\300j\331n\305w\302v\301u\264t\303q\304x\263h\2600\333 </nowiki></tt>''' Don't forget issue 'tic' command.  This supposes you are using PC character set.  The octal values might be different for other character sets.  If you are using termcap instead of terminfo, you should modify above solution appropriately.
 
#Your terminal font might not support line drawing characters. Try changing the font.
 
#Your terminal font might not support line drawing characters. Try changing the font.
 +
 +
=Keyboard Shortcuts=
 +
From the openSUSE Wiki<ref>[http://en.opensuse.org/Midnight_Commander Midnight Commander - openSUSE]</ref>
 +
====Common====
 +
'''Enter''' has few functions:
 +
* if you have text in command line (one with command prompt, above function keys in the last) it will be executed as command
 +
* if command line is empty than it will do something with selected file in active panel:
 +
** if file is executable - it will be executed
 +
** if there is plugin able to open file it will be opened (rpm, tgz, gz, etc)
 +
* '''Ctrl + r''' will refresh active panel
 +
* '''Ctrl + x c''' opens chmod dialog for marked file
 +
* '''Ctrl + x o''' opens chown dialog for marked file
 +
* '''Alt + ?''' opens search dialog
 +
====Panel Functions====
 +
* '''TAB''' is switching focus between left and right panel
 +
* '''Insert''' marks or removes mark on file(s)
 +
* '''Alt + g''' marks first file or directory in active panel
 +
* '''Alt + r''' marks middle file or directory in active panel
 +
* '''Alt + j''' marks last file or directory in active panel
 +
* '''Ctrl + /''' Look for filename given in last line of active panel (not whole screen), and jumps on first file
 +
* '''<nowiki>*</nowiki>''' marks removes marking for all files in active panel (not directories)
 +
* '''+''' (Plus) brings up the input box where it can be given regular expression. All files with names that fill condition(s) in regular expression will be marked.
 +
* '''\''' (Backslash) remove marking for more data (opposite to "+")
 +
====Shell Functions====
 +
* '''Alt + Enter''' copies selected filename in command line
 +
* '''Ctrl + Shift + Enter''' copies full path of selected file in the command line
 +
* '''Alt + H''' shows command line history
 +
====Function Keys====
 +
* '''F1''' Help
 +
* '''F2''' Opens user menu
 +
* '''F3''' View selected file content
 +
* '''F4''' Opens file in internal text editor
 +
* '''F5''' Copies selected file. Default is to another panel, but it asks first.
 +
* '''F6''' Moving file. Default is to another panel, but it asks first.
 +
* '''F7''' Make directory.
 +
* '''F8''' Delete file or directory.
 +
* '''F9''' Opens main menu at the top of the screen.
 +
* '''F10''' Ends current action; editor, viewer, dialog window or ends mc program.
  
 
=References=
 
=References=
 
<references/>
 
<references/>
{{Stubs}}
 

Latest revision as of 20:47, 29 January 2009

400px-Mc-screenshot.png

Contents

Background

Midnight Commander[1] (mc)[2] is an orthodox file manager for Unix-like systems (also works in Windows) and a clone of Norton Commander.

Midnight Commander is a text mode application. The main interface consists of two panels which display the file system. It is used in a similar way to many other programs run in the Unix shell. Arrow keys control file selection, the insert key is used to select files and the Function Keys perform operations such as renaming, editing and copying files. Later versions of the Midnight Commander additionally have mouse support for easier operation. Such versions are aware of running inside an X terminal, which allows them to react to the graphical pointer and update the name of the window in which Midnight Commander runs.

Midnight Commander's features include the ability to view the contents of RPM package files, to work with common archive formats as if they were simply another directory, and to function as an FTP client. Midnight Commander also includes an editor called mcedit. mcedit is a separate executable, which can also be used independently of Midnight Commander. mcedit's features include syntax highlighting for certain languages, and the ability to work in both ASCII and hex modes. Users also have the option to replace mcedit with the editor of their choice.

Midnight Commander can also rename groups of files, unlike a number of other file managers that can only rename one file at a time. This is convenient for manipulating large collections of files, e.g. to make them conform to a new naming convention. Midnight Commander can also move files to a different directory at the same time as it renames them. It lets the user specify the original and resulting file names using wildcard characters. This makes the power of regular expressions in Unix or Linux available for renaming files, with a convenient user interface. In addition, the user can select whether or not to utilize "shell patterns" (automatic grouping of wildcards). All of these features are available by using the File > Rename/Move menu selection. (Pressing F1 would then produce a brief explanation of the options, including examples of how to use wildcards.)

Midnight Commander is now included in most Linux distributions and is licensed under GNU General Public License.

It is very popular on Linux due to being based on versatile text interfaces, such as Ncurses or S-Lang, which allow it to work on a regular console, inside an X Window terminal, over SSH connections and all kinds of remote shells.

Installation

Nuvola apps important.png 
WARNING!

This is a work in progress, all of the content of this article has not been verified to work, use it at your own risk


Raw Binaries

PowerPC

Compiled by casaschi and packaged by izzy - forces use of characters +, |, - for line drawing. If you want to save space (about 1M), copy only the files from bin/ to /bin. The stuff from usr/ is only needed for syntax-highlightning, VFS support (browse tar/zip/... files like directories) and online help[3]

wget http://downloads.nas-central.org/mirrors/linkstationbinaries.webhop.net/ppc/mc_ppc261.tgz
tar -C / -xzvf mc_ppc261.tgz

Midnight Commander should be available by executing

mc

despite the filename, this is version 4.6.1 of Midnight Commander


Another PPC Release...

Midnight Commander for the Terastation and Linkstation : Porting and packaging of Midnight Commander 4.6. Versions available for users of the the Buffalo Linkstation with Motorola PowerPC core (HD-HLAN PowerPC [LS1]) and the Tera Station (HD-HTGL + HS-HTGL ppc [TS]).

An alternative, totally unsupported tarball for Midnight Commander 4.61 can be found here. It is kinda big because all of the supporting libraries are in the archive. If you already have glib and libgpm on your terastation or LS, you can do without the /usr/lib directory.

This build of MC4.61 works pretty good with the OpenTera firmware update which can be found here. It was derived from the MC4.61 distributed in Debian PPC distros.

In short, I ripped it off from a FreeLink install on my LS120.

Rootoftheproblem 20:24, 13 December 2007 (CST)

LSPro/Live (Stock)

Compiled by Kaiten. glib is not included in the stock firmwares. It is available below.

wget http://downloads.nas-central.org/Users/kaiten/mc-4.6.1_arm9.tgz
wget http://downloads.nas-central.org/Users/kaiten/glib-2.12.12_arm9.tgz
tar -C / -xzvf mc-4.6.1_arm9.tgz
tar -C / -xzvf glib-2.12.12_arm9.tgz
ldconfig -v

Midnight Commander should be available by executing

mc

Report issues here [4]

FreeLink

Use apt-get to install Midnight Commander

apt-get install mc

OpenLink

PowerPC

ipkg install mc

MIPSel

Alexander Skwar has created a fairly extensive selection of Ipkg packages for the MIPSel (LS2) LinkStation, Install Ipkg and enable his feed:

ipkg install mc

Attention: installing MC by using ipkg will download and install version 2.3.2 of libc6 - overwriting in a process libpthread-0.10.so with older version

Why don't line drawing characters work?

Since version 4.0.13 there's the command line option -a to force use of characters +, |, - for line drawing (only available when compiled with S-Lang). Use the -a option if any of the suggestions below doesn't help.[7]

In general, there are three cases:

  • Lines are shown as ASCII characters like this
+---------+
|         |
+---------+
This also happens when you use the -a option. Other than that possible reason is 1 or 2 (see below).
  • Lines are shown as lower case characters like this
lqqqqqqqqqk
x         x
mqqqqqqqqqj
Possible reason is 1 or 2 (see below).
  • Lines are shown as blanks or missing characters. Possible reason is 2 or 3 (see below).

The reason for the problem is one of following:

  1. Your terminal might not support line drawing characters. VT100 compatible terminals, rxvt and xterm and color_xterm do support them.
  2. Your terminfo or termcap database might have missing or incorrect definitions for line drawing characters. Set the acsc variable in the terminfo database like this: acsc=a\376k\277l\332m\300j\331n\305w\302v\301u\264t\303q\304x\263h\2600\333 Don't forget issue 'tic' command. This supposes you are using PC character set. The octal values might be different for other character sets. If you are using termcap instead of terminfo, you should modify above solution appropriately.
  3. Your terminal font might not support line drawing characters. Try changing the font.

Keyboard Shortcuts

From the openSUSE Wiki[8]

Common

Enter has few functions:

  • if you have text in command line (one with command prompt, above function keys in the last) it will be executed as command
  • if command line is empty than it will do something with selected file in active panel:
    • if file is executable - it will be executed
    • if there is plugin able to open file it will be opened (rpm, tgz, gz, etc)
  • Ctrl + r will refresh active panel
  • Ctrl + x c opens chmod dialog for marked file
  • Ctrl + x o opens chown dialog for marked file
  • Alt + ? opens search dialog

Panel Functions

  • TAB is switching focus between left and right panel
  • Insert marks or removes mark on file(s)
  • Alt + g marks first file or directory in active panel
  • Alt + r marks middle file or directory in active panel
  • Alt + j marks last file or directory in active panel
  • Ctrl + / Look for filename given in last line of active panel (not whole screen), and jumps on first file
  • * marks removes marking for all files in active panel (not directories)
  • + (Plus) brings up the input box where it can be given regular expression. All files with names that fill condition(s) in regular expression will be marked.
  • \ (Backslash) remove marking for more data (opposite to "+")

Shell Functions

  • Alt + Enter copies selected filename in command line
  • Ctrl + Shift + Enter copies full path of selected file in the command line
  • Alt + H shows command line history

Function Keys

  • F1 Help
  • F2 Opens user menu
  • F3 View selected file content
  • F4 Opens file in internal text editor
  • F5 Copies selected file. Default is to another panel, but it asks first.
  • F6 Moving file. Default is to another panel, but it asks first.
  • F7 Make directory.
  • F8 Delete file or directory.
  • F9 Opens main menu at the top of the screen.
  • F10 Ends current action; editor, viewer, dialog window or ends mc program.

References

  1. Wikipedia: Midnight Commander
  2. The official site of GNU Midnight Commander
  3. The NAS-Central Community Forum / Terastation (ppc) / How to install Midnight Commander ?
  4. The NAS-Central Community Forum / LS Pro/Live / Midnight Commander ?
  5. The NAS-Central Community Forum / Linkstation 2 (mips) / midnight commander (or similar) on LS?
  6. The NAS-Central Community Forum / Linkstation 2 (mips) / Search for Midnight Commander LS2
  7. GNU Midnight Commander: Frequently Asked Questions
  8. Midnight Commander - openSUSE