A good tutorial can be found at Midnight Commander Guide. There is a mail
list for MC in which you can ask questions and share tips: https://mail.gnome.org/archives/mc/.
There at least a half-dozen of entry level tutorial for Mc on the Web including several YouTube videos (just search for Midnight commander
on Youtube):
Visibility of the directory and immediate visual feedback present some of sysadmins
blunders and corresponding horror stories. As such mc is highly recommended tool for system administrators.
Some novices complain that mc is just too idiosyncratic for them. Here is a pretty typical lament that the user
jhfry wrote in his response to Slashdot story
Midnight Commander
Development Revived (January 26 2009)
Anyone else regret not getting attached to tools like MC years ago?
There are a few tools that pop
up whenever people discuss the easiest or best way to do a task... and I always wish I had made the investment of time to get
proficient with those tools. However it almost seems too late.
For example, vi and emacs... I am sure they are great, but the investment of time to get proficient makes it hard to justify
even trying. So on my headless linux boxen I use nano, I can do everything I need to do without a cheatsheet.
MC is the same way... I have tinkered with it, but I always found myself exiting to the command line because I would find something
I didn't know how to do and didn't want to take the time to figure it out.
Does anyone have any tips on how to best add these types of tools to your tool set when you've
mastered an alternative. Simply saying to use it doesn't take into consideration productivity.
Are these tools worth investing personal time into, say instead of studying for a certification or something. Are the gains
really that significant?
There is no royal way to mastering of mc. But, truth be told, MC allow "exiting to command line" by just pressingCtrl-O.
Then you can "return" to mc dual panel screen by pressing Ctrl-O another time. That means that you can gradually learn the ropes and
at the beginning to use mc just as a tool to see the currently directory with one click. The guy in the post reproduced
above also failed to understand the simplest thing: that the bar below contains the main commands (so called F-commands which can
be invoked by functional keys F1-F10) and this bar items are clickable by mouse. That probably represents level-zero of usage of
mc.
It would be better if MC exported its macros to environmental variables in the shell so that you can operate with the current file,
directory in the passive panel and the current file in the passive panel via macros like in mc command line:
%f -- The current file name. %F -- The current file in the passive panel.
%d -- The current directory name. %D -- The directory name of the passive panel.
%t -- The currently tagged files. %T -- The tagged files in the passive panel.
But this export can be emulated "seamlessly" if you program macro in programmable keyboard or keypad.For example,
Logitech G110 gaming keyboard or, better,
Logitech G13 Programmable Keypad with LCD Display (which can
be used with any keyboard). You can also create a user menu item that writes the content of those macros your home directory in
a form of export statements and then "source" this file in your bashrc.
At the same time, you can't get far in masteringmc without investing some time experimenting
with it and reading documentation. It is a different paradigm of working with shell (see
Orthodox system interface ). But there is some critical mass
of efforts after which you do start doing operation of "subconscious" level, as a part of your motor skills, and they become a part
of you "kinetic memory". You now can execute some typical sequences of keystroke semi-automatically, like a good piano player.
And that's the goal.
I still remember this "I got it" moment and after that I just could not understand why initial learning was so difficult for me (I
came to NC from Xtree). In other words you need a critical mass of investment in time and effort that will be handsomely paid
off. And the the main advantage on investing time and energy is MC is that it probably will be available for the rest of your
life.
For example, I use OFMs since 1989. That's almost 30 years and those skills that I acquired in 1989
with NC 2.0 are still by-and-large valid. This is not the case with most commercial products, which that often are discontinued or changed
in such a way to make previous skills obsolete for facilitate upgrades. MS Word is one good example here. Few skills acquired with MS
Word 5.0 for DOS (I typeset a book using MS Word 5.0, so I did make a huge investment is acquiring MS Word skills) are valid now.
And this is not a completely bad application, where the key ideas preserved, albeit in crippled and somewhat perverted form. Although
in the most recent version (Office 365) Microsoft managed to screw up even basic functionality of MS Word. But at least
a decent versions like MS Word 2007 still exists, so effort of learning it still pays. How long nobody knows. And
that's the problem. With MC you can be pretty sure enjoy the same interface and functionality in 2050 if you live that long ;-)
With programmer editors the situation might be worse. While it is an essential instrument of programmer and learning programmable
editor with macro language pays many time, the survival rate of such editors is low, if we are talking about timespan of more then 20
years. For example both the Kedit and MultiEdit are not abandonware:
An excellent editor DOS and then Windows 3.1 editor MultiEdit.
It barely survived. The most recent release is dated from 2008. As of 2011, it was one of the few surviving editors from the
DOS era when text editors were regarded as indispensable programming tools.
An excellent editor for Windows 3.1 Kedit, which is a derivative
of IBM Xedit. KEDIT first became available in 1983. It is derivative of Xedit from VM/CMS OS, and it has very good Unix implementation
THE editor.
There are very few editors that survived from the time of PC revolution when DOS ruled the globe (let's say from 1986) for 30 years.
Among them:
VI
Emacs
While mcedit, a built-in editor is far from the power of, say, Kedit it is a much better
deal then nano. for example it allow to edit multiple files simultaneously and move "selection" between them with ease.
In a way users, who do not want to invest time and energy into learning mc are hopeless. Like old English proverb aptly
states "Nothing venture, nothing have." (Noght venter noght haue. [1546 J. Heywood Dialogue of Proverbs i. xi. E1]).
That's the main tip for those who want to mastermc ;-).
You need to take some steps to make MC to exit in the current directory visible on the screen. One way is to use alias such as
alias mc='mc -P "/tmp/mc-$USER/mc.pwd.$$"; cd `cat /tmp/mc-$USER/mc.pwd.$$`; rm /tmp/mc-$USER/*'
The other is to use a supplied with mc more generic script
alias mc='. /usr/libexec/mc/mc-wrapper.sh'
One of the most common problems with mc is incorrect display of pseudo-graphical characters, which spoils borders on the
panels and while this defect does not affect functionality, is very unpleasant aesthetically. See
Midnight commander does not display pseudo-graphic characters
properly for more information. You can use option -a to use regular characters instead and in most cases this is an
adequate solution.
Another possible fix that sometimes work is to try using LANG=C mc instead of mc.
Please, a small question - I made the new installation (FC3, KDE) and run MC (the great SW!!). Everything works, except that
borders on the panels are drawn by 'a umlaut' instead of pseudo-graphic (lines)
This is a locale and termcap issue which I do not fully understand.
Fortunately I do know a workaround. :) Use this:
LANG=C mc
Other common issues and little know features:
You can change sizes of each panel making them asymmetrical, which is useful for displaying long names via Options/Layout/Panel_split.
I find useful 33%/66% split so that light panel is approximately twice larger then the left.
You can also change from vertical split to horizontal one, in which the width of each panel is equal to the width of the
terminal screen. that allows to display usner and permissions in wider panel.
Ctrl-O opens shell prompt. Another Ctrl-O return panels.
Strings that you copied on any of the panels can be pasted to the command line.
MC simplified using "safe" editing of files: make a backup, copy it to some directory, edit it, test it and then copy back.
This is important when working on remote servers when you blunder might means a trip of say 100 miles in the most inopportune
moment. See Sysadmin Horror Stories
To copy the name of the current file into the command like instead of Alt-Enter (put the current file in
the command line) you can use Esc-Enter (this is useful for Cygwin as Windows uses Alt-Enter for maximizing
screen, and this is a useful shortcut to disable)
Recommended fonts for Midnight commander
For Cygwin you can use Fixedsys 11
terminus is the best font for linux
Multi-screen feature: support of many opened editors and viewers (#1490)
You can concurrently run multiple viewers and editors (screens). Use following default hotkeys:
shortcut
description
Meta + `
Show list of screens: viewers, editors and file panel
TIP: Often you need to use "learn key functionality to enable some keys on your keyboard (for example Grey + and grey - ). You need
to save the results of leraning for them to work, so don't forget to get to save menu and press enter at then end of this exercise.
Home, or Alt-< - move to the top of the directory listing
End, or Alt-> - move to the end of the directory listing
Ctrl-X V, or Ctrl-X S create symbolic link
Alt-C or Esc-C -- quick cd (opens a box with history of previous directories and selecting them is quicker
to type than retyping.
Ctrl-O -- Hide panels and expose command window.
Ctrl-U -- Swap left and right panel
Space Toggle tick boxes ++++++++-++on or off
Tab key also moves sequentially through fields of selection boxes
Ins or Ctrl-T -- select file (actually this is a toggle)
Ctrl-R -- refresh or rescan directory view
Alt-shift ? -- find file (also available from top menu F9/command/find file)
Ctrl-X D -- compare directories (release ctrl-x before pressing d)
Ctrl-X I information about file
Ctrl-X X,L -- symlink, link file
Shift-Grey+ or Shift + -- select group. Can enter wildcards to highlight a certain type or name of file.
Shift-Grey- or Shift - -- deselect group.
Grey* or Shift * - reverse selection. Changes highlighting to all unselected files. Handy to use these two in combination
if you are trying to quickly select all but a certain group.
Shift-* select all /deselectall (toggle)
Ctrl-X-C -- built-in graphic chmod command,
Ctrl-X-O -- built-in graphic chown command
Alt-O or Esc-O make passive panel directory equivalent to the active.
Shift + - select group. Can enter wildcards to highlight a certain type or name of file.
Shift * - reverse selection. Changes highlighting to all unselected files. Handy to use these two in combination if
you are trying to quickly select all but a certain group.
• \ - unselect group. Opposite of +.
As most sysadmin now access servers using Windows desktop and terminal emulator, usage of programmable keyboard can dramatically
increase your productivity.
I would recommend Logitech G510s gaming keyboard
It provides 18 macro keys and allows
LUA scripting for macros. Macros
can help to solve some nasty problems with MC. For example MC does not export the values of macrovariables to shell window when you
press Ctrl-O. But using programmable keyboard you can create a macro and assign it to say key G18 which:
Runs user command assigned to say letter e (F2-e) that export value of all macro variable into export statements
and write this file to your home directly under some fixed name or the current date and session id (if you use multiple sessions).
For example
Please note that the current directory of the active panel corresponds to the value of $PWD. you you do not need to export it. You
can also create a loop to accomplish the same with less number of lines.
Presses Ctrl-O and then executes dot command on this newly created file
. ~/mv_env
(you can alias it to .m; just add alias .m='. ~/mc_env' to your profile )
After that all MC built-in macros are available for usage in commands and scripts as env variables.
Instead of Alt-Enter (put the current file in the command line) you can use Esc-Enter (this is useful
for Cygwin as Windows uses Alt-Enter for maximizing screen, and this is a useful shortcut to disable)
You can add the path from the active and passive panels Ctrl-X P and Ctrl-X Ctrl-P. Pasting the file name is
Ctrl-X T. There is a quick cd command (which in version 4.8.1 can be used to rsync panel directory with shell terminal
screen directory.
You can use macrovariables in the command string (see below).
Click on [^] at the right corner of command line shows history of commands, which is browsable. (also availbel
via menu F9/Ccommand/FCommand history)
Hitting Ctrl-O in viewer and editor expose console screen and allow typing commands in it.
Alt-O -- Switch to the directory on the passive panel identical to the directory on the active panel hotkey
Equlize directories on both panels -- put the directory on active panel in the holist and then switch to the other
panel and retrieve it.
Tab, ArrowUp, ArrowDn or Ctrl-I moves from one menu field to another ArrowUp or
ArrowDown and Enter, or use the 'hotkey' - the highlighted letter in each menu item.
F10 closes menu
ArrowLeft, ArrowRight, Home,End help to navigate entered string
Mouse click on [^] produces history, Esc close the history
The directory listing can be displayed in several different formats. Pressing Alt-t to cycles through them.
There are
Full: gives a standard view.
a dual column format,
Long: a format resembling the output of ls -l called full (single column on the screen) shows permissions,
ownership and long file names in full, but removes the other pane to make space.
Custom, where you can define fields to be displayed (press F1 to see proper name when you at this tab). See
Creating Custom Format
Listing Mode allows you to change how your directory is displayed. Brief: shows contents in two columns on that pane.
You can also cycle through these views by using Alt - t.
In Listing Mode, tick "User Mini Status" which will handily display the permissions of the presently highlighted
file or directory within the separate line at the bottom of the panel.
There is also an "information mode." This will display detailed file system information in the other panel about
the selected item in the current panel. To invoke this mode, type Ctrl-x i. To return the other panel to its normal state,
type Ctrl-x i again.
You can create your own format. Some userful keywords for custom fields are
size
mtime
owner
group
perm
you can also change format of the summary line. it makes sense to display owner and permissions
You can adjust the displayed digits with the column size option, see the “Listing mode” section in the manual. The file
to edit is ~/.config/mc/panels.ini.
To list the file sizes as K, M or G use a narrow size column using the user_format
key:
[New Left Panel]
user_format=half type name mark size:4 space mtime
If you want the size without abbreviation, reserve enough space for it:
[New Right Panel]
user_format=half type name mark size:16 space mtime
From the manual:
Listing Mode...
The listing mode view is used to display a listing of files, there are four different listing modes available: Full, Brief, Long
and User. The full directory view shows the file name, the size of the file and the modification time.
The brief view shows only the file name and it has from 1 up to 9 columns (therefore showing more files unlike other views). The
long view is similar to the output of "Is -1" command. The long view takes the whole screen width.
If you choose the "User" display format, then you have to specify the display format.
The user display format must start with a panel size specifier. This may be "half" or "full", and they specify a half screen panel
and a full screen panel respectively.
After the panel size, you may specify how many listings to fit in the panel, side-by-side (in other words: how many times to repeat
the fields horizontally). This defaults to 1. You may change this by adding a number from
1 to 9 to the format string.
After this you add the name of the fields with an optional size specifier. This
are the available fields you may display:
name displays the file name.
size displays the file size.
bsize is an alternative form of the size format. It displays the size of the files and for directories it just shows
SUB-DIR or UP--DIR.
type displays a one character wide type field. This character is similar to what is displayed by Is with the -F flag
- * for executable files, / for directories, @ for links, = for sockets, - for character devices, + for block devices,
I for pipes, ~ for symbolic links to directories and ! for stale symlinks (links that point nowhere).
mark an asterisk if the file is tagged, a space if it's not.
mtime file's last modification time.
atime file's last access time.
ctime file's status change time.
perm a string representing the current permission bits of the file
mode an octal value with the current permission bits of the file.
nlink the number of links to the file.
ngid the GID (numeric).
nuid the UID (numeric).
owner the owner of the file.
group the group of the file.
inode the inode of the file.
Also you can use following keywords to define the panel layout:
space a space in the display format.
| add a vertical line to the display format.
To force one field to a fixed size (a size specifier), you just add : followed by the number of characters you want the field
to have. If the number is followed by the symbol +, then the size specifies the minimal field size - if
the program finds out that there is more space on the screen, it will then expand that field.
For example, the Full display corresponds to this format:
half type name | size | mtime
And the Long display corresponds to this format:
full perm space nlink space owner space group space size space mtime space name
Few people understand that you you can pipe output of any command into viewer with Alt-!. That make viewing logs more eeffficent
Ctrl-O in viewer and editor hide the window and exposes the console screen.
Ctrl-X-Q Quick viewer
Ctrl-X-I -- information about file is quick view window
allows to execute arbitrary Unix command and pipe output into built-in viewer.
Alt-! The viewer supports "/" and "?" for regex search, the hotkeys that are standard for many Unix
utilities (vi, less, etc).
F3 in viewer exits the viewer. That seems to be a minor thing but this feature proved to be very useful and I
recommend it as a standard key binding for viewer in any OFM.
Ctrl-O in viewer and editor hide the window and exposes the console screen.
Multi-screen feature: support of many opened editors and viewers (#1490)
Here Meta means Alt key as PC keyboard lack proper meta key.
You can concurrently run multiple viewers and editors (screens). Use following default hotkeys:
shortcut
description
Meta + `
Show list of screens: viewers, editors and file panel
Few people understand the mcedit has multiwindow capability. After you open it with you first file you can open another files
using editor menu and then you can "cat and paste" fragments of text between them with ease using save selection to the clipfile feature
(Edit/Save to clipfile) and then switch to the second window and paste from the clipfile in the point you need this
selection.
Ctrl-O in editor hide the window and exposes the console screen.
Selection using mouse (F3 key usage is somewaht awkward)
Ability to save selection to a file and inset this file into another window (possibly using macro)
Built-in internal editor user menu. Key panel elements (current file on active panel, the current file on passive panel,
path to active panel, path to passive panel, highlighted files on active/passive panel, etc) are exportable to the editor as
macrovariables and can be inserted into the text via editor user menu. See mcedit for details
Alt-b Hotkey for finding matching bracket is
Ctrl-O in viewer and editor hides the editor window and exposes the console screen.
Multi-screen feature: support of many opened editors and viewers (#1490)
You can concurrently run multiple viewers and editors (screens). Use following default hotkeys:
shortcut
description
Meta + `
Show list of screens: viewers, editors and file panel
Meta + {
Switch to previous screen
Meta + }
Switch to next screen
You can open the editor in a separate windows if you use screen or tmux. To accomplish this you need create a bash
script, not a function. Then set EDITOR value to it, for example:
mcdiff: Internal diff viewer of GNU Midnight Commander.Index of mcdiff man page
Read mcdiff man page on Linux: $ man 1 mcdiffNAME mcdiff - Internal diff viewer of GNU Midnight Commander.
USAGEmcdiff [-bcCdfhstVx?] file1 file2 DESCRIPTION
mcdiff is a link to mc , the main GNU Midnight Commander executable. Executing GNU Midnight Commander under this name requests
starting the internal diff viewer which compares file1 and file2 specified on the command line.
OPTIONS
-b
Force black and white display.
-c
Force color mode on terminals where mcdiff defaults to black and white.
Specify a different color set. See the Colors section in mc (1) for
more information.
-d
Disable mouse support.
-f
Display the compiled-in search paths for Midnight Commander files.
-t
Used only if the code was compiled with S-Lang and terminfo: it makes the Midnight Commander use the value of the TERMCAP
variable for the terminal information instead of the information on the system wide terminal database
-V
Displays the version of the program.
-x
Forces xterm mode. Used when running on xterm-capable terminals (two screen modes, and able to send mouse escape sequences).
COLORS The default colors may be changed by appending to the MC_COLOR_TABLE environment variable. Foreground and background
colors pairs may be specified for example with:
There is a very simple test that allow you to distinguish advance mc user from a novice. Ask him/her to press F2 and show you the
user menu. If the user menu is default this is a novice.
Despite being very basic MC user menu is a very powerful tool that allow to code many typical operation which became available
to you with just two keystrokes.The following macrovariables(you can use them both in your own user menu entries and on
command line) are available (See also MC Macro Variables ):
%f The current file name. %F The current file in the passive panel.
%d The current directory name. %D The directory name of the passive panel.
%t The currently tagged files. %T The tagged files in the passive panel.
"%u" and "%U" Similar to the %t and %T macros, but after the operation all the files are
untagged (can be used only once per menu entry).
%s and %S The tagged files if there are any. Otherwise the current file.
%cd This is a special macro that is used to change the current directory to the directory specified in front of it.
This is used primarily as an interface to the VFS.
%view the invocation of the internal viewer
"%%" The % character
"%{Enter some text}" Prompt for the substitution (in the example given, the prompt will be "Enter some text"), each
time the command is executed.
"Learn macrovariables" is a great tip. For example to symlink the file to opposite pane you can add to the user menu
with just a couple of lines (for example with the short key l):
l Symlink the current file to the directory in opposite (passive) panel
ln -s %d/%p $D/%p
Similarly you can create a shortcut for creating "in-place" backup of the file:
b Create a time stamped backup is the same directory
cp %f %f.`date +"%y%m%d"`
I recommend to print your mc.menu file and put in it above your monitor for reference. Details of how to write user menu items are
in provides in MC Context Sensitive User Menu
Mc is also great for working with tar files, gzip and zip archives.
Additional way of integration with the underling OS shell via so called User menu and extension menu using the same set of
macro variables that are available for command line. This way "user menu" provide a user with he capability to write his own
simple extensions some of which can be quite useful. Here is an example taken from Midnight Commander User menu (which has a unique
feature that it is dynamic and only those items of the menu that are applicable to the current file type and presence/absence of
selected files are shown to the user):
= t r
+ ! t
y Gzip or unzip current file
unset DECOMP
case %f in
*.gz) DECOMP=-d;;
*.[zZ]) DECOMP=-d;;
esac
gzip $DECOMP -v %f
+ t t
Y Gzip or gunzip tagged files
for i in %t
do
unset DECOMP
case "$i" in
*.gz) DECOMP=-d;;
*.[zZ]) DECOMP=-d;;
esac
gzip $DECOMP -v "$i"
done
+ f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t
z Extract compressed tar file to subdirectory
unset D
set gzip -cd
case %f in
*.tar.gz) D="`basename %f .tar.gz`";;
*.tgz) D="`basename %f .tgz`";;
*.tpz) D="`basename %f .tpz`";;
*.tar.Z) D="`basename %f .tar.Z`";;
*.tar.z) D="`basename %f .tar.z`";;
*.tar.bz2) D="`basename %f .tar.bz2`"; set bunzip2 -c ;;
*.tar.F) D="`basename %f .tar.F`"; set freeze -dc;
esac
mkdir "$D"; cd "$D" && ("$1" "$2" ../%f | tar xvf -)
+ t t
Z Extract compressed tar files to subdirectories
for i in %t
do
set gzip -dc
unset D
case "$i" in
*.tar.gz) D="`basename $i .tar.gz`";;
*.tgz) D="`basename $i .tgz`";;
*.tpz) D="`basename $i .tpz`";;
*.tar.Z) D="`basename $i .tar.Z`";;
*.tar.z) D="`basename $i .tar.z`";;
*.tar.F) D="`basename $i .tar.F`"; set freeze -dc;;
*.tar.bz2) D="`basename $i .tar.bz2`"; set bunzip2 -c;;
esac
mkdir "$D"; (cd "$D" && "$1" "$2" "../$i" | tar xvf -)
done
This idea of user menu was extended to the mc internal editor which has an additional macro variable %b to which you can direct
the output of shell command for insertion into editor buffer and vise versa.
This is a valuable innovation. Generally in version 4.8.1 editor looks more promising and more modern then in previous version although
it still is lack in quality and capabilities in comparison with FTE (while
having some unique features).
Multi-screen feature: support of many opened editors and viewers instead of one (#1490)
You can concurrently run multiple viewers and editors (screens). Use following default hotkeys:
shortcut
description
Meta + `
Show list of screens: viewers, editors and file panel
Meta + {
Switch to previous screen
Meta + }
Switch to next screen
"External panelize" command (executing an arbitrary command and putting the resulting file listing in a panel, so that
it can be used for navigating. This was really great idea that was still never implemented in other OFMs. MC implementation need
capabilities of hiding full path like in FAR.
Columns in the panels can be sorted using mouse click like in Total Commander (version 4.7 and later).
Context-sensitive, dynamic user menu based on "visibility predicates". MC pioneered concept of context-sensitive
user menu items. Each item has it's "visibility predicate" which determine conditions under which the this item will be displayed
in the menu.
You can assign viewer and editor for files with given extension (for example .pdf) via extension
menu. Both can be assigned depending on the result of a predicate (or even script) evaluation. Script can filter the file
before passing it to the viewer (very useful for viewing log files). Concept of "actions" was introduced in extension menu. So pressing
F3 is one action, while pressing F4 is another, and pressing Enter is yet another one. You can assign
a program for each action (viewer for F3, editor for F4 and so on for files with given extension (for example
.pdf) via extension menu.Both can be assigned depending on the result of a predicate (or even script) evaluation.
Script can filter the file before passing it to the viewer (very useful for viewing log files)
"History of everything" and command completion in all dialogs. That's really highly helpful feature for advanced users.
History of commands entered in command line is available by clicking [^] in the right corner with the mouse.
Mouse drag and drop is working even in Teraterm (4.8 and later versions)
Better than in previous versions implementation of command console interface (4.8 and later versions). Probably the first
support of "real" Unix console via "Ctrl-O". Addition of path from the left and right panels (Ctrl-[ and Ctrl-]) were implemented
as Ctrl-X P and Ctrl-X P. Pasting the file name (Ctrl-I) is Ctrl-X T. There is also a hotkey for active panel directory path Alt-A
and for quick cd command.Paradoxically before MC 4.8 using OFMs were extremely weak in this area as if programmers who wrote
them were completely limited to Windows experience and did not understand of value of integration of shell and file manager the OFM
support.
Correct implementation of Ctrl-O functionality in viewer and editor -- editor or viewer are hidden and console screen
is exposed.
Full power of regular expressions in selections and search. For example, in panel selections the list "*.txt; *.bat;
*.inf; *.doc" can be specified as "*.(doc|bat|inf|doc)".
RegEx-based search capabilities. Like in NC5, XTree "flat" VFS can be emulated in MC using panelize command (search
for *), but without macros this emulation is pretty painful.
Dynamic construction of the directory tree. The idea itself is rather interesting taking into account the real height
of directory tree that we see in Red Hat and other Linux distributions with Gnome installed. But unfortunately the existing implementation
breaks OFM doctrine as the tree is build from root, not from the current directory and that somewhat limits its usability for quick
search of files and navigation. The directory tree expand/collapse should happens automatically in the vicinity of the user view
on the tree. Currently you need manually use F2 (rescan) to open the branch that interests you. Still the problem here is
the cost of full scanning of the tree in a typical unix system.
Configurable display information (you can select your own directory display format)
The circular ring of predefined display formats switchable via Alt-T.
Attempts to provide some hotkeys for working with the current directory. Jumping to the top file, middle file and the
last file on the panel are provided (only Alt-G (the top) and Alt-J (the bottom) actually work now); That can be extended to potentially
more useful jumps to the top subdirectory, middle subdirectory and the last subdirectory in the current panel (often there are only
two or three subdirectories; in this case those three keys select subdirectory unambiguously).
Dynamic Bottom Toolbar. MC 4.6.0 is probably the only Unix OFMs that supports the concept of dynamic toolbar
(in Viewer, Editor, and Directory Search panel).. Dynamic toolbar is a very useful instant help system and should be used whenever
possible. Unfortunately, the key bar doesn't change when Alt, Ctrl, or Shift are pressed like in FAR and FC. It's probably hard to
implement it in a portable way in Unix with its limited PC keyboard support.
Instead of Alt-Enter (put the current file in the command line) which often does not work, you can use Esc-Enter.
This tip works for other shortcuts too.
This idea of user menu was extended to the mc internal editor which has an additional macro variable %b to which you can
direct the output of shell command for insertion into editor buffer and vise versa. This is a valuable innovation. Generally
in version 4.8.1 editor looks more promising and more modern then in previous version although it still is lack in quality and capabilities
from FTE, which I strongly recommend as an external editor for Midnight
Commander.
Tilde is a text editor for the console/terminal, which provides an intuitive interface for
people accustomed to GUI environments such as Gnome, KDE and Windows. For example, the
short-cut to copy the current selection is Control-C, and to paste the previously copied text
the short-cut Control-V can be used. As another example, the File menu can be accessed by
pressing Meta-F.
However, being a terminal-based program there are limitations. Not all terminals provide
sufficient information to the client programs to make Tilde behave in the most intuitive way.
When this is the case, Tilde provides work-arounds which should be easy to work with.
The main audience for Tilde is users who normally work in GUI environments, but sometimes
require an editor for a console/terminal environment. This may be because the computer in
question is a server which does not provide a GUI, or is accessed remotely over SSH. Tilde
allows these users to edit files without having to learn a completely new interface, such as vi
or Emacs do. A result of this choice is that Tilde will not provide all the fancy features that
Vim or Emacs provide, but only the most used features.
NewsTilde version
1.1.2 released
This release fixes a bug where Tilde would discard read lines before an invalid character,
while requested to continue reading.
23-May-2020
Tilde version 1.1.1 released
This release fixes a build failure on C++14 and later compilers
Alt + , - switch mc 's layout from left-right to top-bottom.
Mind = blown. Useful for operating on files with long names.
Alt + t - switch the panel's listing mode in a loop: default, brief, long,
user-defined. "long" is especially useful, because it maximises one panel so that it takes
full width of the window and longer filenames fit on screen.
Alt + i - synchronize the active panel with the other panel. That is, show
the current directory in the other panel.
Ctrl + u - swap panels.
Alt + o - if the currently selected file is a directory, load that directory
on the other panel and move the selection to the next file. If the currently selected file is
not a directory, load the parent directory on the other panel and moves the selection to the
next file. This is useful for quick checking the contents of a list of directories.
Ctrl + PgUp (or just left arrow, if you've enabled Lynx-like
motion , see later) - move to the parent directory.
Alt + Shift + h - show the directory history. Might be easier to navigate
than going back one entry at a time.
Alt + y - move to the previous directory in history.
Alt + u - move to the next directory in history.
Common actions
Ctrl + Space - calculate the size of the selected directories. Press this
shortcut when the selection is on .. to calculate the size of all the
directories in the current directory.
Ctrl + x s (that is press Ctrl + x , let it go and then press s ) -
create a symbolic link (change s to l for a hardlink). I find it
very useful and intuitive - the link will, of course, be created in the other panel. You can
change it's destination and name, like with any other file operation.
Ctrl + x c - open the chmod dialog.
Ctrl + x o - open the chown dialog.
Panel options
Show backup files and Show hidden files - I keep both
enabled, as I often work with configuration files, etc.
Lynx-like motion - mentioned above, makes left arrow go to parent
directory, while the right arrow enters the directory under selection. Faster than
Home , Enter , Home , Enter , etc.
This options is quite smart, that is if the shell command line is not empty, the arrows
work as usual and allow moving the cursor in the command line.
Bonus assignments
Define your own listing mode ( Right/Left -> Listing mode...
-> User defined ). Hit F1 to see available columns and
options.
Play around in tree mode: Right/Left -> Tree or
Command -> Directory tree .
the Midnight Commander's built-in editor turned out to be. Below is one of the features of
mc 4.7, namely the use of the ctags / etags utilities together with mcedit to navigate through
the code.
Code Navigation Training
Support for this functionality appeared in mcedit from version 4.7.0-pre1.
To use it, you need to index the directory with the project using the ctags or etags utility,
for this you need to run the following commands:
$ cd /home/user/projects/myproj
$ find . -type f -name "*.[ch]" | etags -lc --declarations -
or $ find . -type f -name "*.[ch]" | ctags --c-kinds=+p --fields=+iaS --extra=+q -e
-L-
After the utility completes, a TAGS file will appear in the root directory of our project,
which mcedit will use.
Well, practically all that needs to be done in order for mcedit to find the definition of the
functions of variables or properties of the object under study.
Using
Imagine that we need to determine the place where the definition of the locked property
of an edit object is located in some source code of a rather large project.
/* Succesful, so unlock both files */
if (different_filename) {
if (save_lock)
edit_unlock_file (exp);
if (edit->locked)
edit->locked = edit_unlock_file (edit->filename);
} else {
if (edit->locked || save_lock)
edit->locked = edit_unlock_file (edit->filename);
}
Using ubuntu 10.10 the editor in mc (midnight commander) is nano. How can i switch to the
internal mc editor (mcedit)?
Isaiah ,
Press the following keys in order, one at a time:
F9 Activates the top menu.
o Selects the Option menu.
c Opens the configuration dialog.
i Toggles the use internal edit option.
s Saves your preferences.
Hurnst , 2014-06-21 02:34:51
Run MC as usual. On the command line right above the bottom row of menu selections type
select-editor . This should open a menu with a list of all of your installed
editors. This is working for me on all my current linux machines.
, 2010-12-09 18:07:18
You can also change the standard editor. Open a terminal and type this command:
sudo update-alternatives --config editor
You will get an list of the installed editors on your system, and you can chose your
favorite.
AntonioK , 2015-01-27 07:06:33
If you want to leave mc and system settings as it is now, you may just run it like
$ EDITOR=mcedit
> ,
Open Midnight Commander, go to Options -> Configuration and check "use internal editor"
Hit save and you are done.
Skip to content
April 24, 2011
by
Admin
Important
This is an edited version of a post that originally appeared on a blog called The Michigan
Telephone Blog, which was written by a friend before he decided to stop blogging. It is
reposted with his permission. Comments dated before the year 2013 were originally posted
to his blog.
If you've installed
Midnight
Commander
and haven't changed the default colors, when you try to access a dropdown menu you
may see this:
REALLY hard to read that menu, isn't it? Wouldn't you rather see this?
To fix the unreadable menus, just make sure Midnight Commander is
not
open,
then use any text editor (such as nano) to open ~/.mc/ini:
nano ~/.mc/ini
Assuming that there is no existing [Colors] section in the file, just add this at the bottom
of the file (if the second line exceeds the blog column width, just use copy and paste to get it
all):
If there is an existing [Colors] section, you can try tweaking it using the parameters shown
above. If you have a very recent version of Midnight Commander (which you probably will have if
you are running Ubuntu), then instead of
menu=
you'll need to use
menunormal=
, as shown here:
Note that for some reason the base_color parameter must appear, or the other items are
ignored. Save the change, exit the editor, and open Midnight Commander. If you then close
Midnight Commander, you may find that the position of the [Colors] section has moved within the
ini file -- apparently Midnight Commander rewrites the file when you close it -- but if you don't
like the changes you can remove the [Colors] section to reverse the change.
The above would compress the current directory (%d) to a file also in the current directory. If you want to compress the directory
pointed to by the cursor rather than the current directory, use %f instead:
tar -czf %f_$(date '+%%Y%%m%%d').tar.gz %f
mc handles escaping of special characters so there is no need to put %f in quotes.
By the way, midnight commander's special treatment of percent signs occurs not just in the user menu file but also at the command
line. This is an issue when using shell commands with constructs like ${var%.c} . At the command line, the same as
in the user menu file, percent signs can be escaped by doubling them.
I need to know how to check the current colour for mc and how to change it.
I google it and they talk about changeing some initial file /.mc/ini which i have no idea
(no one ever gives full filename.)and i cant find it at all. Wasted an hour of my life. I
just need the simplest way to change it, not another 10+ steps to change a stupid
colour.
gengisdave
12-22-2014 03:22 AM
in some distros (mine, e.g.) it is located in ~/.local/mc/ini
sycamorex
12-22-2014 03:24 AM
This is the full filename. Mind you on my distro it's in ~/.config/mc/ini
Find / Create this file and add the following (obviously change the colour values):
The syntax is: variable=foreground_colour,background_colour
Code:
[Colors]
base_color=lightgray,green:normal=green,default:selected=white,gray:marked=yellow,default:markselect=yellow,gray:directory=blue,default:executable=brightgreen,default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red,default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green,gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan,gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan,default:helpnormal=cyan,default:editnormal=green,default:editbold=blue,default:editmarked=gray,blue:stalelink=red,default
Also, have a look at this: http://blog.mybox.ro/2010/05/10/skin...ght-commander/
Editing
Midnight Commander's color scheme In a previous
post I was sort of laying out a "formula" on how to transform your Midnight Commander
default color scheme into a trasnparent skin, without talking too much about how you can change
the other colors.
To my great shame, I didn't pay too much attention to this blog or to the comments asking
for further advice. I found Mateus' comment rather late (just now!) and decided to dig further,
in order to find out how exactly to deal with more refined color changes, while still keeping
the transparent background (in both in Midnight Commander and its editor).
So the first thing to know is which are the colors that Midnight Commander supports; the
available colors are:
black
gray
lightgray
white
red
brightred
green
brightgreen
blue
brightblue
magenta
brightmagenta
cyan
brightcyan
brown
yellow
default
The " default " color is the one giving out the nice transparency.
Now, there are certain "components" in Midnight Commander's display that can have their
colors altered. Here they are:
Each and every one of these "components" can have its own colors set accordingly to the
user's wish. Each component is assigned a color pair and must be followed by a colon (':') in
order to separate it from the color pair of the next component. Here's how this basic syntax
must look like:
component=foreground_color,background_color:
When you start modifying the color scheme in your Midnight Commander configuration file
(located at ~/.mc/ini ), you just have to add a section called " [Colors] " and proceed with
enumerating the color pairs. So you'd have something like this:
For increased readability, I will "truncate" that long line, adding a backslash ('\') to
indicate that in fact what follows on the next line should be adjacent to the text on the
previous line. This being said, the [Colors] section could look like this:
Now that you've gotten the hang of this, let's see how the [Colors] section looks like in
the default Midnight Commander color scheme (you know, the "ugly" one, with blue and dull
cyan):
IMPORTANT NOTE: For visual impact's sake and due to Blogspot breaking long lines, I wrote
each color pair on a single row, followed by a backslash ('\'). Please note that this does NOT
work in the ~/.mc/ini file, so the final [Colors] section in your Midnight Commander
configuration file MUST be a SINGLE line with no spaces and with each color pair separated from
the next one by a colon (':').
Now let's see. What you want to change first of all is most of the background of these
"components", such that the display will be one with a neat looking transparent background. So
first of all you might want to make a few changes to these color pairs by replacing the
background color "blue" with "default". After doing these changes, your [Colors] section will
look a bit like this:
Now you've got the basic "Midnight Commander transparent scheme" that was the result of
this
post .
Proceeding to Mateus' question, regarding how to change the rest of the colors now, it's
about the same as before. What he didn't like there (and as a matter of fact I don't quite like
it, either) is the dull cyan that's still seen in the following places:
the bottom line (the one displaying the F1...F10 function keys);
the line that signifies the current selection, the "prompt" which shows you on which
file/directory you're "on" at a given moment;
the uppermost line (the "menu" line);
the menus themselves, once you open them.
To "fix" issues 1, 2, and 3 it is sufficient to alter the value of the " selected "
parameter. Notice how it is initially
selected=black,cyan:\
My personal choice is to replace the background cyan, which I don't really like, with green.
To do this, I'll change this color pair to
selected=black,green:\
You can, of course, change the foreground color as well. For me, it's alright to keep the
foreground (the text) "black". You can change it to whatever suits your taste.
To "fix" issue number 4 in the list above, you need to change the " menu " parameter. To get
it transparent, just change the "cyan" background to "default". Make other adjustments as you
see fit. In other words, change
menu=white,cyan:\
into, for instance,
menu=ligthgray,default:\
However, there are a few "leftovers" from the default color scheme.
One of them is the parameter regarding the hotkeys in the menus (the "underlined" character
on most of the menu options, showing you what key you can press in order to access that option
faster than by moving to it with the arrow keys). This color pair is called " menuhot ". I
changed it from
menuhot=yellow,cyan:\
into
menuhot=yellow,default:\
Another thing which might bother you is the color of the line in the panel you're in when
you've "selected all" files (when you've pressed the "*" key). This parameter is called "
markselect ". I changed it from
markselect=yellow,cyan:\
into
markselect=white,green:\
The color pair of the selected buttons in dialogs is called " dfocus ". I changed mine
from
dfocus=black,cyan:\
into
dfocus=black,green:\
In the "focused" buttons or options, the underlined character is called " dhotfocus ". I
changed mine from
dhotfocus=blue,cyan:\
into
dhotfocus=brightgreen,green:\
since the background color was already green, after I modified the " dfocus " color
pair.
The other buttons or options in the dialogs which have hotkeys assigned to them, but which
are not "focused" (the buttons/options that you're not located on at a given moment) are still
displayed in blue on a light gray background. This color pair is referred to as " dhotnormal ".
Since the blue looks a bit odd there, I changed
dhotnormal=blue,lightgray:\
into
dhotnormal=brightgreen,default:\
Well, this is nice, in window titles and on normal (unfocused) hotkeys I get the transparent
background. The problem now is that the rest of the dialog window is still light gray. To
change this (to make the window transparent as well), you only need to alter the " dnormal "
color pair, such as changing it from
dnormal=black,lightgray:\
into
dnormal=white,default:\
You may notice that the input fields stay cyan, as well; you find these fields in quite a
lot of dialog boxes. To alter this, I changed
input=black,cyan:\
into
input=black,green:\
One thing which I consider useful is to have symbolic links displayed in bright cyan (as in
the colored listings in the terminal). So I just changed
link=lightgray,default:\
into
link=brightcyan,default:\
Now, regarding the rest of the color pairs, I don't really know what they do. However, if at
some point after using Midnight Commander more with this new, neat, transparent/green color
scheme you'll notice unwanted leftovers, you can try out other changes in the color pairs
values, one at a time, until you determine the troublesome one.
After operating the changes above, my [Colors] section in ~/.mc/ini now looks like this:
I need to direct you to the " IMPORTANT NOTE " above. The final [Colors] section above is
written like this - one pair on each row, followed by a backslash - for clarity's sake. The
actual final [Colors] section in your ~/.mc/ini file will have to be a one-liner, with no
blanks and no backslashes. So it will probably look similar to this:
Note #1: In the above 'code' block, there is only one line below [Colors] . I truncated the
line with the backslash because of blogspot rendering issues. You just write all that on one
single line, without the "\" (backslash-es).
Note #2: At the end of this line, the " editnormal,=default: " option means that mcedit will
have transparent background in your console, as well.
To my great shame, I didn't pay too much attention to this blog or to the comments asking
for further advice. I found Mateus' comment rather late (just now!) and decided to dig further,
in order to find out how exactly to deal with more refined color changes, while still keeping
the transparent background (in both in Midnight Commander and its editor).
So the first thing to know is which are the colors that Midnight Commander supports; the
available colors are:
black
gray
lightgray
white
red
brightred
green
brightgreen
blue
brightblue
magenta
brightmagenta
cyan
brightcyan
brown
yellow
default
The " default " color is the one giving out the nice transparency.
Now, there are certain "components" in Midnight Commander's display that can have their
colors altered. Here they are:
Each and every one of these "components" can have its own colors set accordingly to the
user's wish. Each component is assigned a color pair and must be followed by a colon (':') in
order to separate it from the color pair of the next component. Here's how this basic syntax
must look like:
component=foreground_color,background_color:
When you start modifying the color scheme in your Midnight Commander configuration file
(located at ~/.mc/ini ), you just have to add a section called " [Colors] " and proceed with
enumerating the color pairs. So you'd have something like this:
For increased readability, I will "truncate" that long line, adding a backslash ('\') to
indicate that in fact what follows on the next line should be adjacent to the text on the
previous line. This being said, the [Colors] section could look like this:
Now that you've gotten the hang of this, let's see how the [Colors] section looks like in
the default Midnight Commander color scheme (you know, the "ugly" one, with blue and dull
cyan):
IMPORTANT NOTE: For visual impact's sake and due to Blogspot breaking long lines, I wrote
each color pair on a single row, followed by a backslash ('\'). Please note that this does NOT
work in the ~/.mc/ini file, so the final [Colors] section in your Midnight Commander
configuration file MUST be a SINGLE line with no spaces and with each color pair separated from
the next one by a colon (':').
Now let's see. What you want to change first of all is most of the background of these
"components", such that the display will be one with a neat looking transparent background. So
first of all you might want to make a few changes to these color pairs by replacing the
background color "blue" with "default". After doing these changes, your [Colors] section will
look a bit like this:
Now you've got the basic "Midnight Commander transparent scheme" that was the result of
this
post .
Proceeding to Mateus' question, regarding how to change the rest of the colors now, it's
about the same as before. What he didn't like there (and as a matter of fact I don't quite like
it, either) is the dull cyan that's still seen in the following places:
the bottom line (the one displaying the F1...F10 function keys);
the line that signifies the current selection, the "prompt" which shows you on which
file/directory you're "on" at a given moment;
the uppermost line (the "menu" line);
the menus themselves, once you open them.
To "fix" issues 1, 2, and 3 it is sufficient to alter the value of the " selected "
parameter. Notice how it is initially
selected=black,cyan:\
My personal choice is to replace the background cyan, which I don't really like, with green.
To do this, I'll change this color pair to
selected=black,green:\
You can, of course, change the foreground color as well. For me, it's alright to keep the
foreground (the text) "black". You can change it to whatever suits your taste.
To "fix" issue number 4 in the list above, you need to change the " menu " parameter. To get
it transparent, just change the "cyan" background to "default". Make other adjustments as you
see fit. In other words, change
menu=white,cyan:\
into, for instance,
menu=ligthgray,default:\
However, there are a few "leftovers" from the default color scheme.
One of them is the parameter regarding the hotkeys in the menus (the "underlined" character
on most of the menu options, showing you what key you can press in order to access that option
faster than by moving to it with the arrow keys). This color pair is called " menuhot ". I
changed it from
menuhot=yellow,cyan:\
into
menuhot=yellow,default:\
Another thing which might bother you is the color of the line in the panel you're in when
you've "selected all" files (when you've pressed the "*" key). This parameter is called "
markselect ". I changed it from
markselect=yellow,cyan:\
into
markselect=white,green:\
The color pair of the selected buttons in dialogs is called " dfocus ". I changed mine
from
dfocus=black,cyan:\
into
dfocus=black,green:\
In the "focused" buttons or options, the underlined character is called " dhotfocus ". I
changed mine from
dhotfocus=blue,cyan:\
into
dhotfocus=brightgreen,green:\
since the background color was already green, after I modified the " dfocus " color
pair.
The other buttons or options in the dialogs which have hotkeys assigned to them, but which
are not "focused" (the buttons/options that you're not located on at a given moment) are still
displayed in blue on a light gray background. This color pair is referred to as " dhotnormal ".
Since the blue looks a bit odd there, I changed
dhotnormal=blue,lightgray:\
into
dhotnormal=brightgreen,default:\
Well, this is nice, in window titles and on normal (unfocused) hotkeys I get the transparent
background. The problem now is that the rest of the dialog window is still light gray. To
change this (to make the window transparent as well), you only need to alter the " dnormal "
color pair, such as changing it from
dnormal=black,lightgray:\
into
dnormal=white,default:\
You may notice that the input fields stay cyan, as well; you find these fields in quite a
lot of dialog boxes. To alter this, I changed
input=black,cyan:\
into
input=black,green:\
One thing which I consider useful is to have symbolic links displayed in bright cyan (as in
the colored listings in the terminal). So I just changed
link=lightgray,default:\
into
link=brightcyan,default:\
Now, regarding the rest of the color pairs, I don't really know what they do. However, if at
some point after using Midnight Commander more with this new, neat, transparent/green color
scheme you'll notice unwanted leftovers, you can try out other changes in the color pairs
values, one at a time, until you determine the troublesome one.
After operating the changes above, my [Colors] section in ~/.mc/ini now looks like this:
I need to direct you to the " IMPORTANT NOTE " above. The final [Colors] section above is
written like this - one pair on each row, followed by a backslash - for clarity's sake. The
actual final [Colors] section in your ~/.mc/ini file will have to be a one-liner, with no
blanks and no backslashes. So it will probably look similar to this:
Koszti Lajos Midnight Commander is the most pupular file manager on
unix like systems. It's fast and it has all features what you need. But it's only blue and we
know, that everyone loves the eyecandy, everyone likes customizing his/her own desktop. But is
there any way to custimize the mc ?
Yes, and I try to show you, how can you create your theme .
You can change the Midnight Commander colors if you edit the ~/.mc/ini file, where you have
to add a new section, named [Colors] . You should define the new colors in this section, for
example:
Help colors: helpnormal, helpitalic, helpbold, helplink, helpslink
Viewer color: viewunderline
Special highlighting colors: executable, directory, link, stalelink, device, special,
core
Editor colors: editnormal, editbold, editmarked
And which are the colors? I don't know all, but here are some of them: white, gray, blue, green, yellow, magenta, cyan, red, brown, birghtgreen, brightblue,
brightmagenta, brightcyan, brightred, default
On the screenshot you can see, that the directory color is blue, the files are green, the
executable files are birghtgreen and the selected line is white on a gray background.
And here is a small shell script, which will help for you to test your new theme:
#!/bin/sh mc --colors
normal=green,default:selected=brightmagenta,gray:marked=yellow,default:markselect=yellow,gray:directory=blue,default:executable=brightgreen,default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red,default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green,gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan,gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan,default:helpnormal=cyan,default:editnormal=green,default:editbold=blue,default:editmarked=gray,blue:stalelink=red,default
Save it as mccolortest.sh, make it executable with the chmod +x mccolortest.sh
command, and run it with the ./mccolortest.sh command. If you want to change a color,
just edit this file. When you done, copy the colors and paste it below the [Colors]
section in the ~/.mc/ini . If it doesn't exists, make it yourself.
For more information of the mc redesigning check its manual page .
Also, in 4.8.3 here, I copied the first example scheme line and my colors are different. I
can't even set the background of the select bar to gray (or "grey"): it gets replaced with
black. Also, the panel headings remain blue here, unlike the (first) screenshot, and I can
see no corresponding tag in the line anyway.
Good intro, regardless. Someone should post a pointer to a more up-to-date one, though, as
Google seems to find this old thread within the top few hits. Király! ;)
The colors are depends on the color settings of your terminal. I don't have those settings
anymore which was when I posted this article, but here is my current. If I'm right, it's
similar to that. Put it into your .Xdefaults
Midnight Commander supports skins starting from 4.7.0-pre3 version. You can download a
skin with black as a main color from here:
http://zool.in.ua/software/bluemoon/
I am using MC on my router ASUS WL-500GP and I am developing php scripts on it. but as I
see MC in openwrt (kmaikaze 8.09) does not use syntax-highlighting and it is very
unconfortable.
Do you know how could I turn it on? I have already downloaded php.syntax file and put it into
/usr/share/syntax dir but it does not seem to work. is it possible that some support is not
compiled into my version or the syntax file must be compiled to another format?
Br Zé.
hei ajnasz, your color theme so very nice, keep my eye on my pc longer than usual. Well, i
don't have much time to do more explore with this tricks. I think your taste so cool. If you
have any kind of theme, i should be try it. :-)
I didn't find anything about it. By the way, since the extension doesn't determinate the
file type in UNIX like systems, it wouldn't make any sense to do it.
Don't be silly. Mp3 is just music, txt is text, doc is document. The only thing, which is
not exactly determinable is the executables, but whatever, it has +x flag.
Also, you should know that most modern terminal applications allow you to redefine the
exact shade of those 16 colors.
Some of them (such as the Gnome or KDE terminals) may have a place under their preferences
where you can redefine the colors.
Older terminals, such as aterm, use ~/.Xdefaults for this. You can edit that file and add
lines like this: "aterm*color1: OrangeRed" (without the quotes). What I've done with that is
tell aterm that the "color1" (which was red) should now be "OrangeRed". See
/usr/share/X11/rgb.txt for valid color names. You can use *color0 through *color15. So when
you'll say "red" in MC's ini file, and if you use aterm, it will get replaced by color1 in
~/.Xdefaults and changed to OrangeRed. (Sorry, I don't remember the mappings between the
names used by MC and 0-15 in Xdefaults by heart.)
With tar.gz to extract a file archiver first creates an intermediary tarball x.tar file from
x.tar.gz by uncompressing the whole archive then unpack requested files from this intermediary
tarball. In tar.gz archive is large unpacking can take several hours or even days.
@ChristopheDeTroyer Tarballs are compressed in such a way that you have to decompress
them in full, then take out the file you want. I think that .zip folders are different, so if
you want to be able to take out individual files fast, try them. – GKFX
Jun 3 '16 at 13:04
Yes, just give the full stored path of the file after the tarball name.
Example: suppose you want file etc/apt/sources.list from etc.tar
:
tar -xf etc.tar etc/apt/sources.list
Will extract sources.list and create directories etc/apt under
the current directory.
You can use the -t listing option instead of -x , maybe along
with grep , to find the path of the file you want
You can also extract a single directory
tar has other options like --wildcards , etc. for more advanced
partial extraction scenarios; see man tar
2. Extract it with the Archive Manager
Open the tar in Archive Manager from Nautilus, go down into the folder hierarchy to find
the file you need, and extract it.
On a server or command-line system, use a text-based file manager such as Midnight
Commander ( mc ) to accomplish the same.
3. Using Nautilus/Archive-Mounter
Right-click the tar in Nautilus, and select Open with ArchiveMounter.
The tar will now appear similar to a removable drive on the left, and you can
explore/navigate it like a normal drive and drag/copy/paste any file(s) you need to any
destination.
Midnight Commander uses virtual filesystem ( VFS ) for displying
files, such as contents of a .tar.gz archive, or of .iso image.
This is configured in mc.ext with rules such as this one ( Open is
Enter , View is F3 ):
Another tool that can save you time is Midnight Commander's user menu. Go back to
/tmp/test where you created nine files. Press F2 and bring up the user menu. Select
Compress the current subdirectory (tar.gz) . After you choose the name for the archive,
this will be created in /tmp (one level up from the directory being
compressed). If you highlight the .tar.gz file and press ENTER you'll notice it will open
like a regular directory. This allows you to browse archives and extract files by simply
copying them ( F5 ) to the opposite panel's working directory.
To find out the size of a directory (actually, the size of all the files it contains),
highlight the directory and then press CTRL+SPACE .
To search, go up in your directory tree until you reach the top level, / ,
called root directory. Now press F9 , then c , followed by f . After the Find File dialog
opens, type *.gz . This will find any accessible gzip archive on the system. In
the results dialog, press l (L) for Panelize . All the results will be fed to one of your
panels so you can easily browse, copy, view and so on. If you enter a directory from that
list, you lose the list of found files, but you can easily return to it with F9 , l (L) then
z (to select Panelize from the Left menu).
Managing files is not always done locally. Midnight Commander also supports accessing
remote filesystems through SSH's Secure File Transfer Protocol, SFTP . This way you
can easily transfer files between servers.
Press F9 , followed by l (L), then select the SFTP link menu entry. In the dialog box
titled SFTP to machine enter sftp://[email protected] . Replace
example with the username you have created on the remote machine and
203.0.113.1 with the IP address of your server. This will work only if the
server at the other end accepts password logins. If you're logging in with SSH keys, then
you'll first need to create and/or edit ~/.ssh/config . It could look
something like this:
~/.ssh/config
1
2
3
4
5
Host sftp_server
HostName 203.0.113.1
Port 22
User your_user
IdentityFile ~/.ssh/id_rsa
You can choose whatever you want as the Host value, it's only an identifier.
IdentityFile is the path to your private SSH key.
After the config file is setup, access your SFTP server by typing the identifier value
you set after Host in the SFTP to machine dialog. In this example, enter
sftp_server .
Midnight Commander how to compress a file/directory; Make a tar archive with midnight
commander
To compress a file in Midnight Commader (e.g. to make a tar.gz archive) navigate
to the directory you want to pack and press 'F2'. This will bring up the 'User menu'. Choose
the option 'Compress the current subdirectory'. This will compress the WHOLE directory you're
currently in - not the highlighted directory.
Hello,
Is it possible to customize the columns in the single panel view ?
For my default (two panel) view, I have customized it using:
-> Listing Mode
(*) User defined:
half type name | size:15 | mtime
however, when I switch to the single panel view, there are different
columns (obviously):
Permission Nl Owner Group Size Modify time Name
For instance, I need to change the width of "Size" to 15.
No, you can't change the format of the "Long" listing-mode.
(You can make the "User defined" listing-mode display in one panel (by
changing "half" to "full"), but this is not what you want.)
So, you have two options:
(1) Modify the source code (search panel.c for "full perm space" and
tweak it); or:
(2) Use mc^2. It allows you to do this. (It already comes with a
snippet that enlarges the "Size" field a bit so there'd be room for
the commas (or other locale-dependent formatting) it adds. This makes
reading long numbers much easier.)
Subject : Re: Help: meaning of the panelize command in left/right menus
Date : Fri, 17 Feb 2017 15:00:16 +0100
On Thu, Feb 16, 2017 at 01:25:22PM +1300, William Kimber wrote:
Briefly, if you do a search over several directories you can put all those
files into a single panel. Not withstanding that they are from different
directories.
I'm not sure I understand what you mean here; anyway I noticed that if you do a
search using the "Find file" (M-?) command, choose "Panelize" (at the bottom
of the "Find File" popup window), then change to some other directory (thus
exiting from panelized mode), if you now choose Left -> Panelize, you can recall
the panelized view of the last "Find file" results. Is this what you mean?
However this seems to work only with panelized results coming from the
"Find file" command, not with results from the "External panelize" command:
if I change directory, and then choose Left -> Panelize I get an empty panel.
Is this a bug?
Cri
Re: Help: meaning of the panelize command in left/right menus
From : Cristian Rigamonti <cri linux it>
To : mc gnome org
Subject : Re: Help: meaning of the panelize command in left/right menus
Date : Fri, 17 Feb 2017 15:00:16 +0100
On Thu, Feb 16, 2017 at 01:25:22PM +1300, William Kimber wrote:
Briefly, if you do a search over several directories you can put all those
files into a single panel. Not withstanding that they are from different
directories.
I'm not sure I understand what you mean here; anyway I noticed that if you do a
search using the "Find file" (M-?) command, choose "Panelize" (at the bottom
of the "Find File" popup window), then change to some other directory (thus
exiting from panelized mode), if you now choose Left -> Panelize, you can recall
the panelized view of the last "Find file" results. Is this what you mean?
However this seems to work only with panelized results coming from the
"Find file" command, not with results from the "External panelize" command:
if I change directory, and then choose Left -> Panelize I get an empty panel.
Is this a bug?
Cri
Hello,
Is it possible to customize the columns in the single panel view ?
For my default (two panel) view, I have customized it using:
-> Listing Mode
(*) User defined:
half type name | size:15 | mtime
however, when I switch to the single panel view, there are different
columns (obviously):
Permission Nl Owner Group Size Modify time Name
For instance, I need to change the width of "Size" to 15.
No, you can't change the format of the "Long" listing-mode.
(You can make the "User defined" listing-mode display in one panel (by
changing "half" to "full"), but this is not what you want.)
So, you have two options:
(1) Modify the source code (search panel.c for "full perm space" and
tweak it); or:
(2) Use mc^2. It allows you to do this. (It already comes with a
snippet that enlarges the "Size" field a bit so there'd be room for
the commas (or other locale-dependent formatting) it adds. This makes
reading long numbers much easier.)
Hi!
My mc version:
$ mc --version
GNU Midnight Commander 4.8.19
System: Fedora 24
I just want to tell you that %f macro in mcedit is not correct. It
contains the current file name that is selected in the panel but not
the actual file name that is opened in mcedit.
I created the mcedit item to run C++ program:
+= f \.cpp$
r Run
clear
app_path=/tmp/$(uuidgen)
if g++ -o $app_path "%f"; then
$app_path
rm $app_path
fi
echo 'Press any key to exit.'
read -s -n 1
Imagine that I opened the file a.cpp in mcedit.
Then I pressed alt+` and switched to panel.
Then I selected (or even opened in mcedit) the file b.cpp.
Then I pressed alt+` and switched to mcedit with a.cpp.
Then I executed the "Run" item from user menu.
And... The b.cpp will be compiled and run. This is wrong! Why b.cpp???
I executed "Run" from a.cpp!
I propose you to do the new macros for mcedit.
%opened_file
- the file name that is opened in current instance of mcedit.
%opened_file_full_path
- as %opened_file but full path to that file.
I think that %opened_file may be not safe because the current
directory may be changed in mc panel. So it is better to use
%opened_file_full_path.
%opened_file_dir
- full path to directory where %opened_file is.
%save
- save opened file before executing the menu commands. May be useful
in some cases. For example I don't want to press F2 every time before
run changed code.
Thanks for the mc.
Best regards, Sergiy Vovk.
I'd like mc to open /home/keith/Documents/ in the left panel as well whenever I start
mc up, so both panels are showing the /home/keith/Documents/ directory.
Is there some way to tell mc how to do this please?
I think you could use: `mc <path> <path>`, for instance:
`mc /home/keith/Documents/ /tmp`, but of course this requires you to know
the second path to open in addition to your ~/Documents. Not really
satisfying?
Regards,
Hi wwp,
Thanks for your suggestion and that seems to work OK - I just start mc with the following
command:
mc ~/Documents
and both panes are opened at the ~Documents directories now which is fine.
Description I think that it is necessary that code base mc and mc2 correspond
each other. mooffie? can you check that patches from andrew_b easy merged with mc2 and if some
patch conflict with mc2 code hold this changes by writing about in corresponding ticket.
zaytsev can you help automate this( continues integration, travis and so on). Sorry, but some
words in Russian:
Ребята, я не
пытаюсь давать
ЦУ, Вы делаете
классную
работу. Просто
яхотел
обратить
внимание, что
Муфья пытается
поддерживать
свой код в
актуальном
состоянии, но
видя как у него
возникают
проблемы на
ровном месте
боюсь
энтузиазм у
него может
пропасть. Change
Historycomment:1 Changed 2
years ago by zaytsev-work
I have asked what plans does mooffie have for mc 2 sometime ago and never got an
answer. Note that I totally don't blame him for that. Everyone here is working at their own
pace. Sometimes I disappear for weeks or months, because I can't get a spare 5 minutes not even
speaking of several hours due to the non-mc related workload. I hope that one day we'll figure
out the way towards merging it, and eventually get it done.
In the mean time, he's working together with us by offering extremely important and
well-prepared contributions, which are a pleasure to deal with and we are integrating them as
fast as we can, so it's not like we are at war and not talking to each other.
Anyways, creating random noise in the ticket tracking system will not help to advance your
cause. The only way to influence the process is to invest serious amount of time in the
development. comment:2
Changed 2
years ago by zaytsev
Now, I assume most of you here aren't users of MC.
So I won't bore you with description of how Lua makes MC a better
file-manager. Instead, I'll just list some details that may interest
any developer who works on extending some application.
And, as you'll shortly see, you may find mc^2 useful even if you
aren't a user of MC!
So, some interesting details:
* Programmer Goodies
- You can restart the Lua system from within MC.
- Since MC has a built-in editor, you can edit Lua code right there
and restart Lua. So it's somewhat like a live IDE:
- It comes with programmer utilities: regular expressions; global scope
protected by default; good pretty printer for Lua tables; calculator
where you can type Lua expressions; the editor can "lint" Lua code (and
flag uses of global variables).
- It installs a /usr/bin/mcscript executable letting you use all the
goodies from "outside" MC:
- You can program a UI (user interface) very easily. The API is fun
yet powerful. It has some DOM/JavaScript borrowings in it: you can
attach functions to events like on_click, on_change, etc. The API
uses "properties", so your code tends to be short and readable:
I defined my own listing mode and I'd like to make it permanent so that on the next mc
start my defined listing mode will be set. I found no configuration file for mc.
,
You have probably Auto save setup turned off in
Options->Configuration menu.
You can save the configuration manually by Options->Save setup .
Panels setup is saved to ~/.config/mc/panels.ini .
Now, I assume most of you here aren't users of MC.
So I won't bore you with description of how Lua makes MC a better
file-manager. Instead, I'll just list some details that may interest
any developer who works on extending some application.
And, as you'll shortly see, you may find mc^2 useful even if you
aren't a user of MC!
So, some interesting details:
* Programmer Goodies
- You can restart the Lua system from within MC.
- Since MC has a built-in editor, you can edit Lua code right there
and restart Lua. So it's somewhat like a live IDE:
- It comes with programmer utilities: regular expressions; global scope
protected by default; good pretty printer for Lua tables; calculator
where you can type Lua expressions; the editor can "lint" Lua code (and
flag uses of global variables).
- It installs a /usr/bin/mcscript executable letting you use all the
goodies from "outside" MC:
- You can program a UI (user interface) very easily. The API is fun
yet powerful. It has some DOM/JavaScript borrowings in it: you can
attach functions to events like on_click, on_change, etc. The API
uses "properties", so your code tends to be short and readable:
On Fri, 27 Jul 2018 17:01:17 +0300 Sergey Naumov via mc-devel wrote:
I'm curious whether there is a way to change default configuration that is
generated when user invokes mc for the first time?
For example, I want "use_internal_edit" to be true by default instead of
false for any new user.
In vanilla mc the initial value of use_internal_edit is true. Some distros
(Debian and some others) change this to false.
If there is a way to do it, then is it possible to just use lines that I
want to change, not the whole configuration, say
[Midnight-Commander]
use_internal_edit=true
Before first run, ~/.config/mc/ini doesn't exist.
If ~/.config/mc/ini doesn't exist, /etc/mc/mc.ini is used.
If /etc/mc/mc.ini doesn't exist, /usr/share/mc/mc.ini is used.
You can create one of these files with required default settings set.
Unfortunately, there is no info about /etc/mc/mc.ini in the man page.
I'll fix that at this weekend.
Yes, it does, if it has been compiled accordingly.
http://www.linux-databook.info/wp-content/uploads/2015/04/MC-02.jpeg
On Thu, 15 Nov 2018, Fourhundred Thecat wrote:
Hello,
I need to connect to server where I don't have shell access (no ssh)
the server only allows sftp. I can connect with winscp, for instance.
does mc support sftp as well ?
thanks,
_______________________________________________
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc
Hi, I'm wondering why following happens:
In Ubuntu and FreeBSD, when I am pressing Ctrl+J in MC, it puts name
of file on which file cursor is currently on. But this doesn't work in
CentOS and RHEL.
How to fix that in CentOS and RHEL?
Ivan.
Never heard about Ctrl+j, I always used Alt+Enter for that purpose.
Alt+a does the same thing for the path, BTW (just in case you didn't
know). :-)
HTH,
Thomas
_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel
I haven't found anything on the topic in the Internet. The only line from
.mc/ini that looks related to the question is keymap=mc.keymap but I
have no idea what to do with it.
$ man-section mc | head -n20
mc (1)
--
Name
Usage
Description
Options
Overview
Mouse support
Keys
Redefine hotkey bindings
8th section... is that possible? Lets look
man mc (scroll,scroll,scroll)
Redefine hotkey bindings
Hotkey bindings may be read from external file (keymap-file). A keymap-
file is searched on the following algorithm (to the first one found):
1) command line option -K <keymap> or --keymap=<keymap>
2) Environment variable MC_KEYMAP
3) Parameter keymap in section [Midnight-Commander] of config file.
4) File ~/.config/mc/mc.keymap
5) File /etc/mc/mc.keymap
6) File /usr/share/mc/mc.keymap
Bingo!
cp /etc/mc/mc.keymap ~/.config/mc/
Now edit the key mappings as you like and save ~/.config/mc/mc.keymap when done
For more info, read the Keys ( man mc ) section and the three sections following that.
If I do $EDITOR some_file then I get the file open in vim in another tmux
windows - exactly what I wanted.
Sadly, when I try to edit in MC it goes blank for a second and then returns to normal MC
window. MC doesn't seem to keep any logs and I don't get any error message.
The question(s)
Do you know what I'm doing wrong?
Do you have a usable workaround for what I want?
Should I create a feature request/bug for MC?
Tags :midnight-commanderAnswers 1
You are defining a shell function, which is unknown for mc when it is trying to
start the editor.
The correct way is to create a bash script, not a function. Then set EDITOR
value to it, for example:
Many people don't know that mc has a multi-window text-editor built-in (eerily disabled by
default) with macro capability and all sorts of goodies. run
If the Find file dialog (accessible with Alt+? ) shows no results, check
the current directory for symbolic links. Find file does not follow symbolic links, so
use bind mounts (see mount(8) ) instead, or the External
panelize command.
Midnight Commander does not support a trash can by default. Using
libtrash
Install the libtrashAUR
package, and create an mc alias in the initialization file of your shell (e.g.,
~/.bashrc or ~/.zshrc ):
alias mc='LD_PRELOAD=/usr/lib/libtrash.so.3.3 mc'
To apply the changes, reopen your shell session or source the shell
initialization file.
Default settings are defined in /etc/libtrash.conf.sys . You can overwrite
these settings per-user in ~/.libtrash , for example:
TRASH_CAN = .Trash
INTERCEPT_RENAME = NO
IGNORE_EXTENSIONS= o;exe;com
UNCOVER_DIRS=/dev
Now files deleted by Midnight Commander (launched with mc ) will be moved to the
~/.Trash directory.
Warning:
Applications launched from mc inherit LD_PRELOAD , which may cause
problems with some applications. [1]
With GLOBAL_PROTECTION = YES set (default), files deleted outside the home
directory are moved to the trash, even if they are on a different partition. Depending on the
file, this may cause a significant delay.
In Midnight Commander, is it possible to exclude some directories/patterns/... when doing search? ( M-? ) I'm specifically
interested in skipping the .hg subdirectory.
Answers 1In the "[Misc]" section of your ~/.mc/ini file, you can specify the directories you wish to skip in the "find_ignore_dirs" setting.
To specify multiple directories, use a colon (":") as the delimiter.
You can get
tab-completion by pressing ESC then TAB . You can also get the currently
highlighted file/subdir name onto the command line with ESC-ENTER.
I recently installed openSUSE 13.1 and set up the mc in typical why by aliasing
mc with mc-wrapper.sh to have it exit into the last working directory in
mc instance. However this does not seem to be working. I tried to debug the
mc-wrapper.sh script - the echo commands.
MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
/usr/bin/mc -P "$MC_PWD_FILE" "$@"
if test -r "$MC_PWD_FILE"; then
MC_PWD="`cat "$MC_PWD_FILE"`"
if test -n "$MC_PWD" && test -d "$MC_PWD"; then
echo "will cd in : $MC_PWD"
cd $MC_PWD
echo $(pwd)
fi
unset MC_PWD
fi
rm -f "$MC_PWD_FILE"
unset MC_PWD_FILE
echo $(pwd)
To my surprise, mc-wrapper-sh does change the directory and is in the directory
before exiting but back in bash prompt the working directory is the one from which the script
was invoked.
Can it be that some bash settings is required for this to work?
If MC displays funny characters, make sure the terminal emulator uses UTF8 encoding.
Smooth scrolling
vi ~/.mc/ini (per user) or /etc/mc/mc.ini (system-wide):
panel_scroll_pages=0
Make both panels display the same directory
ALT+i. If NOK, try ESC+i
Navigate through history
ESC+y to go back to the previous directory, ESC+u to go the next
Options > Configuration > Lynx-like motion doesn't go through the navigation history
but rather jumps in/out of a directory so the user doesn't have to hit PageUp followed by
Enter
Loop through all items starting with the same letter
CTRL+s followed by the letter to jump to the first occurence, then keep hitting CTRL+s to
loop through the list
"... MC_HOME variable can be set to alternative path prior to starting mc. Man pages are not something you can find the answer right away =) ..."
"... A small drawback of this solution: if you set MC_HOME to a directory different from your usual HOME, mc will ignore the content of your usual ~/.bashrc so, for example, your custom aliases defined in that file won't work anymore. Workaround: add a symlink to your ~/.bashrc into the new MC_HOME directory ..."
That turned out to be simpler as one might think. MC_HOME variable can be set to alternative
path prior to starting mc. Man pages are not something you can find the answer right away =)
You have to share the same user name on remote server (access can be distinguished by rsa
keys) and want to use your favorite mc configuration w/o overwriting it. Concurrent sessions
do not interfere each other.
A small drawback of this solution: if you set MC_HOME to a directory different from your
usual HOME, mc will ignore the content of your usual ~/.bashrc so, for example, your custom
aliases defined in that file won't work anymore. Workaround: add a symlink to your ~/.bashrc
into the new MC_HOME directory – Cri
Sep 5 '16 at 10:26
If you mean, you want to be able to run two instances of mc as the same user at the same
time with different config directories, as far as I can tell you can't. The path is
hardcoded.
However, if you mean, you want to be able to switch which config directory is being used,
here's an idea (tested, works). You probably want to do it without mc running:
Create a directory $HOME/mc_conf , with a subdirectory, one
.
Move the contents of $HOME/.config/mc into the
$HOME/mc_conf/one subdirectory
Duplicate the one directory as $HOME/mc_conf/two .
Create a script, $HOME/bin/switch_mc :
#!/bin/bash
configBase=$HOME/mc_conf
linkPath=$HOME/.config/mc
if [ -z $1 ] || [ ! -e "$configBase/$1" ]; then
echo "Valid subdirecory name required."
exit 1
fi
killall mc
rm $linkPath
ln -sv $configBase/$1 $linkPath
Run this, switch_mc one . rm will bark about no such file,
that doesn't matter.
Hopefully it's clear what's happening there -- this sets a the config directory path as a
symlink. Whatever configuration changes you now make and save will be int the
one directory. You can then exit and switch_mc two , reverting to
the old config, then start mc again, make changes and save them, etc.
You could get away with removing the killall mc and playing around; the
configuration stuff is in the ini file, which is read at start-up (so you can't
switch on the fly this way). It's then not touched until exit unless you "Save setup", but at
exit it may be overwritten, so the danger here is that you erase something you did earlier or
outside of the running instance.
that works indeed, your idea is pretty clear, thank you for your time However my idea was to
be able run differently configured mc's under the same account not interfering each other. I
should have specified that in my question. The path to config dir is in fact hardcoded, but
it is hardcoded RELATIVELY to user's home dir, that is the value of $HOME, thus changing it before mc start DOES change the config dir location - I've checked that. the drawback is
$HOME stays changed as long as mc runs, which could be resolved if mc had a kind of startup
hook to put restore to original HOME into – Tagwint
Dec 18 '14 at 16:52
mc
/ mcedit has a config option called auto_save_setup which is enabled
by default. This option automatically saves your current setup upon exiting. The problem occurs
when you try to edit ~/.config/mc/ini using mcedit . It will
overwrite whatever changes you made upon exiting, so you must edit the
~/.config/mc/ini using a different editor such as nano .
at the bottom (top, if ineffective) of your ~/.bashrc file. Thus you can load skins as
in
mc -S sand256.ini
In
/home/you/.config/mc/ini
have the lines:
[Midnight-Commander]
skin=sand256
for preset skin. Newer mc version offer to choose a preset skin from within the menu and
save it in the above ini file, relieving you of the above manual step.
Many people don't know that mc has a multi-window text-editor built-in (eerily disabled by
default) with macro capability and all sorts of goodies. run
mc -e my.txt
to edit directly.
Be aware that many skins break the special characters for sorting filenames reverse up/down
unless one works hard with locale parameters and what not. Few people in the world know how to
do that properly. In below screenshot you see "arrowdown n" over the filename list to indicate
sort order. In many xterm, you will get ??? instead so you might resort to unskin and go to
"default skin" setting with ugly colours.
The below CTRL-O hotkey starts what mc calls a subshell. If you run mc a second time in a
"subshell", mc will not remind you of the CTRL-O hotkey (as if the world only knows 3 hotkeys)
but will start mc with no deeper "subshell" iteration possible, unless one modifies the
sources.
mcdiff: Internal diff viewer of GNU Midnight Commander.Index of
mcdiff man page
Read mcdiff man page on Linux: $ man 1 mcdiffNAME mcdiff - Internal diff
viewer of GNU Midnight Commander. USAGEmcdiff [-bcCdfhstVx?] file1 file2
DESCRIPTION
mcdiff is a link to mc , the main GNU Midnight Commander executable. Executing GNU
Midnight Commander under this name requests starting the internal diff viewer which compares
file1 and file2 specified on the command line.
OPTIONS
-b
Force black and white display.
-c
Force color mode on terminals where mcdiff defaults to black and white.
Specify a different color set. See the Colors section in mc
(1) for more information.
-d
Disable mouse support.
-f
Display the compiled-in search paths for Midnight Commander files.
-t
Used only if the code was compiled with S-Lang and terminfo: it makes the Midnight
Commander use the value of the TERMCAP variable for the terminal information instead
of the information on the system wide terminal database
-V
Displays the version of the program.
-x
Forces xterm mode. Used when running on xterm-capable terminals (two screen modes, and
able to send mouse escape sequences).
COLORS The default colors may be changed by appending to the MC_COLOR_TABLE
environment variable. Foreground and background colors pairs may be specified for example with:
Something I discovered which I REALLY appreciated was the hide/view of hidden files can be
toggled by pressing ALT-. (ALT-PERIOD). Be aware that often the RIGHT ALT key is NOT seen as an
ALT key by the system, so you usually need to use Left-ALT-. to toggle this. I forgot about the
Right-ALT weirdness and thought I'd broken mc one day. {sigh} Such a blonde...
Just checked (xev!), I guess the ALT-. toggle is mapped to ALT_L-., and the right ALT key
gives an ALT_R keycode... which doesn't match the mc mapping, causing it to not work... now I
know why! Hooray!
1) If the panels are active and I issue a command that has a lot of
output, it appears to be lost forever.
i.e., if the panels are visible and I cat something (i.e., cat /proc/cpuinfo), that info is
gone forever once the panels get redrawn.
If you use Cygwin's mintty
terminal, you can use its Flip Screen context menu command (or Alt+F12 shortcut) to
switch between the so-called alternate screen, where fullscreen applications like mc
normally run, and the primary screen where output from commands such as cat
appears.
You can create hard links and symbolic links using C-x l and C-x s keyboard shortcuts.
However, these two shortcuts invoke two completely different dialogs.
While for C-x s you get 2 pre-populated fields (path to the existing file, and path to the
link – which is pre-populated with your opposite file panel path plus the name of the
file under cursor; simply try it to see what I mean), for C-x l you only get 1 empty field:
path of the hard link to create for a file under cursor. Symlink's behaviour would be much more
convenient
Fortunately, a good man called Wiseman1024 created a feature request in the MC's bug tracker 6
years ago. Not only had he done so, but he had also uploaded a sample mc user
menu script ( local copy ), which
works wonderfully! You can select multiple files, then F2 l (lower-case L), and hard-links to
your selected files (or a file under cursor) will be created in the opposite file panel. Great,
thank you Wiseman1024 !
Word of warning: you must know what hard links are and what their limitations are
before using this menu script. You also must check and understand the user menu code before
adding it to your mc (by F9 C m u , and then pasting the script from the file).
Word of hope: 4 years ago Wiseman's feature request was assigned to Future Releases
version, so a more convenient C-x l will (sooner or later) become the part of mc.
Hopefully.
If you ever need to select lots (hundreds, thousands) of files by their
modification date, and your directory contains many more files (thousands, tens of thousands),
then angel_il has the answer for you:
touch -d "Jun 01 00:00 2011″ /tmp/.date1
enter into your BIG dir
press C-x ! (External panelize)
add new command like a "find . -type f \( -newer /tmp/.date1 \) -print"
I've used a slightly different approach, specifying desired date right in the command line
of External Panelize:
enter your directory with many files
press C-x ! (External Panelize)
add a command like find . -type f -newermt "2017-02-01 23:55:00" -print (
man find for more details)
In both cases, the created panel will only have files matching your search condition.
I defined my own listing mode and I'd like to make it permanent so that on the next mc start my defined listing mode will be
set. I found no configuration file for mc.
1 Answer 1
You have probably Auto save setup turned off in Options->Configuration menu.
You can save the configuration
manually by Options->Save setup.
You can adjust the displayed digits with the column size option, see the "Listing mode" section in the manual. The
file to edit is ~/.config/mc/panels.ini.
To list the file sizes as K, M or G use a narrow size column using the user_format
key:
[New Left Panel]
user_format=half type name mark size:4 space mtime
If you want the size without abbreviation, reserve enough space for it:
[New Right Panel]
user_format=half type name mark size:16 space mtime
Although Midnight Commander is a text mode application it can make use of
mouse. The openSUSE delivered mc will make use of the mouse when used
with a GUI
console, without any further configuration needed.
The text mode terminal that we
get when booting in
runlevels 2 or 3 is a bit different story. You have to install the package
gpm ("general purpose mouse") which is also called
mouse server. The gpm is used in Linux to receive movements and clicks from mouse. Start
gpm and then start Midnight commander.
If you come to the text terminal using Ctrl + Alt + F1, then
gpm will not work as another driver that belongs to
GUI (X
Server) claims control over the mouse.
... ... ...
FTP browsing
This is file browsing on remote FTP server just as it is on your computer.
Press F9 to select drop down menus on the top of the screen.
Press Alt + L if you want to use left side panel, or Alt + R
for right panel.
Press Alt + P for input box where you have enter server name. Enter for instance
ftp.gwdg.de/pub
and press Enter.
Now mc will try anonymous connection to remote machine. If machine responds, you'll get
directory listing of /pub on remote server.
It is possible to do the same from mc command line by typing:
cd /#ftp:ftp.gwdg.de/pub
Archive browsing
Archive in classic meaning is compressed file. In Linux you can recognize them by suffix like:
tgz, tar.gz, tbz, tar.bz2
and many more, but above few are the most used
Highlight the file
Press Enter
That's it. Midnight Commander will decompress file for you and present it's internal structure
like any other directory. If you want to extract one or all files from archive mark what you want
toextract and use F5 to copy in another panel. Done.
RPM browsing
The package installation files for any SUSE are
RPM and
mc will let you browse them.
Highlight the file
Press Enter
You'll see few files:
/INFO
CONTENTS.cpio
HEADER
*INSTALL
*UPGRADE
Browse to see details of your RPM.
The CONTENTS.cpio is actual archive with files, and if you want to see within:
Highlight the file
Press Enter
(You know the drill)
The *INSTALL and *UPGRADE will do what the name tells, but if you want only to extract one or
more files from CONTENTS.cpio than use F5 to copy them in the directory in the
other panel.
PuTTY and line drawing
PuTTY is terminal application used to access remote computers running Linux via ssh (SSH
tunnels from Microsoft Windows see details). The line drawing in Midnight Commander, YaST and
another applications that draw lines using special characters can be displayed wrong as something
else. The solution is to change settings:
menu: Window > Translation:
Received data assumed to be in which character set: UTF-8
Handling of line drawing characters: Use Unicode for line drawing
If that doesn't help, you may set this too:
menu: Connection > Connection-type string: linux
menu: Terminal > Keyboard > The Function keys and keypad: Linux
+ t r & ! t t
d Diff against file of same name in other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
if [ -f %D/%f ]; then # if two of them, then
diff -up %f %D/%f | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
else
echo %f: No copy in %D/%f
fi
D Diff current directory against other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
diff -up %d %D | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
fi
If you've used an *nix system, at some point you've stumbled upon Midnight
Commander, a file manager based on the venerable Norton Commander. You're probably familiar with the basic operations (F5
for copying, F6 for moving, F8 for deleting, etc.) and how to switch panels (ummm, the Tab
key). But mc offers so much more than that. This article aims to show all the useful (YMMV) shortcuts and functionalities
that are often overlooked. Most of them can be accessed using the menu (F9), but who has the time to do that?
Before we get started, let's establish some facts. This article was written and tested on the following software:
Midnight Commander 4.8.13
GNU bash 4.2.53
Oh, and make sure you're running a modern and UTF-8 friendly terminal - for example, rxvt-unicode.
Hold your horses
There's actually one thing I'd recommend doing before you run mc. mc has the ability to exit to its
current directory. Meaning, you can navigate the filesystem using mc (sometimes it's easier than cping
into that one directory buried deep down somewhere) and when you quit mc (F10), your shell will
automagically cd to that directory. This is done thanks to the mc-wrapper script that should be bundled
with your installation of mc. The exact location is dependent on your distribution - in mine (Gentoo) it's /usr/libexec/mc/,
in Ubuntu supposedly it's in /usr/share/mc/bin/. Once found, modify your ~/.bashrc:
alias mc='. /usr/libexec/mc/mc-wrapper.sh'
Restart your shell, launch mc, change to another directory, exit and your shell should be set to that new directory.
Selecting files
Insert (Ctrl + t alternatively) - select files (for example, for copying, moving or deleting).
+ - select files based on a pattern.
\ -unselect files based on a pattern.
* - reverse selection. If nothing was selected, all files will get selected.
Accessing the shell
There's a shell awaiting your command at the bottom of the screen - just start typing (when no other command dialog is open,
of course).
Since Tab is bound to switching panels (or moving the focus in dialogs), you have to use Esc Tab
to use autocompletion. Hit it twice to get all the possible completions (just like in a shell). This works in dialogs too.
If you want inspect the output of the command, do some input or just prefer a bigger console, no need to quit mc.
Just hit Ctrl + o - the effect will be similar to putting mc in the background but with a nice perk.
Your current working directory from mc will be passed on to the shell… and vice versa! Hit Ctrl + o
again to return to mc.
Ctrl + Enter or Alt + Enter - copy the currently selected file's name to the shell.
Ctrl + Shift + Enter - same as above, but the full path is copied.
Internal viewer (F3) and editor (F4)
The internal viewer has many built in modes for "previewing" the content of the file. Try "viewing" a binary, an archive,
a DOC document or an image. In some cases, external programs are needed in order for this "previewing" to work.
If you want to preview the "raw" contents of the file, hit Shift + F3.
While the internal viewer and editor are powerful, sometimes you want to use your preferred software (coughvimcough).
You can do so by setting the PAGER (for viewer) and EDITOR (for editor) variables (for example, in your
~/.bashrc file). Then toggle the Options -> Configuration -> Use interal edit/view option (access the
top menu by pressing F9).
Panels
Alt + , - switch mc's layout from left-right to top-bottom. Mind = blown. Useful for operating on
files with long names.
Alt + t - switch the panel's listing mode in a loop: default, brief, long, user-defined. "long" is especially
useful, because it maximises one panel so that it takes full width of the window and longer filenames fit on screen.
Alt + i - synchronize the active panel with the other panel. That is, show the current directory in the other
panel.
Ctrl + u - swap panels.
Alt + o - if the currently selected file is a directory, load that directory on the other panel and move the
selection to the next file. If the currently selected file is not a directory, load the parent directory on the other panel and
moves the selection to the next file. This is useful for quick checking the contents of a list of directories.
Ctrl + PgUp (or just left arrow, if you've enabled Lynx-like motion, see later) - move to the parent
directory.
Alt + Shift + h - show the directory history. Might be easier to navigate than going back one entry at a time.
Alt + y - move to the previous directory in history.
Alt + u - move to the next directory in history.
Searching files
Alt + ? - shows the full Find dialog.
Alt + s or Ctrl + s - quick search mode. Start typing and the selection will move to the first matching
file. Press the shortcut again to jump to another match. Use wildcards (*, ?) for easier matching.
Common actions
Ctrl + Space - calculate the size of the selected directories. Press this shortcut when the selection is on
.. to calculate the size of all the directories in the current directory.
Ctrl + x s (that is press Ctrl + x, let it
go and then press s) - create a symbolic link (change s to l for a hardlink). I find
it very useful and intuitive - the link will, of course, be created in the other panel. You can change it's destination and name,
like with any other file operation.
Ctrl + x c - open the chmod dialog.
Ctrl + x o - open the chown dialog.
Virtual File System (VFS)
mc has a concept known as Virtual File System. Try "entering" an archive (*.tar.gz, *.rpm
or even *.jar) - you'll be able to browse the contents of the archive like a normal folder, without unpacking it first.
You extract selected files from the archive by just copying them to the other panel. Bonus points: try "entering" a… *.patch
file.
This concept is even more powerful when you realize that remote locations can be viewed the same way. A quick way to browse an
FTP location is to just cd to it: cd ftp://mirrors.tera-byte.com/pub/gentoo (first Gentoo FTP mirror I
found). You'll be able to interact with files as you normally do. To exit this remote location, cd to a local directory.
Just typing cd will suffice as it will take you to your home directory.
VFS works for SFTP and Samba shares too. Check the manpages for more information on how to specify user/pass, etc.
Useful options
Configuration
Verbose operation and Compute totals - so that operations like copy/move have a more detailed
progress dialogs.
Layout
Equal split - uncheck to define your own ratio for panels. Maybe you prefer one panel bigger than the other?
Useful especially if you keep one of the panels in tree mode (or maybe info/quick view, too).
Uncheck Hintbar visible - one more line available, one less line of noise.
Panel options
Show backup files and Show hidden files - I keep both enabled, as I often work with configuration
files, etc.
Lynx-like motion - mentioned above, makes left arrow go to parent directory, while the right arrow enters
the directory under selection. Faster than Home, Enter, Home, Enter, etc.
This options is quite smart, that is if the shell command line is not empty, the arrows work as usual and allow moving the
cursor in the command line.
File highlight -> File types is useful, as it uses a different color for example for executable
files. Permissions, for me, is not that useful, but I can definitely see it's use, for example, for sysadmins.
... ... ...
Bonus assignments
Define your own listing mode (Right/Left -> Listing mode... -> User defined). Hit
F1 to see available columns and options.
Play around in tree mode: Right/Left -> Tree or Command -> Directory tree.
Compare directories (Ctrl + x d)
Fill up the directory hotlist (Ctrl + \)
Well, that was a lot to take in. Of course, this list is not complete (that's what man mc is there for), but I've
selected the commands and functionalities that are the most useful to me. Embrace the ones you find useful, forget the rest
and learn about the other ones I've missed!
SFTP filesystem in Midnight Commander 4.8.17 and later
The SFTP file system is a network based file system that allows you to
manipulate the files in a remote machine as if they were local.
To connect to a remote machine, you just need to chdir into a special directory
which name is in the following format:
sftp://fuser@dnsname:[port]/[remote-dir]
The user, port and remote-dir elements are optional. If you specify the user
element, the Midnight Commander will try to login on the remote machine as that
user, otherwise it will use your login name, port - specify the port used by
remote server (22 by default). If the remote-dir element is present, your
current directory on the remote machine will be set to this one.
Although Midnight Commander is a text mode application it can make use of mouse. The openSUSE delivered mc will make use
of the mouse when used with a GUI console, without any
further configuration needed.
The text mode terminal that we get when booting in
runlevels 2 or 3 is a bit different
story. You have to install the package
gpm ("general purpose mouse") which
is also called mouse server. The gpm is used in Linux to receive movements and clicks from mouse. Start gpm and then start
Midnight commander.
If you come to the text terminal using Ctrl + Alt + F1, then
gpm will not work as another driver
that belongs to GUI (X
Server) claims control over the mouse.
... ... ...
FTP browsing
This is file browsing on remote FTP server just as it is on your computer.
Press F9 to select drop down menus on the top of the screen.
Press Alt + L if you want to use left side panel, or Alt + R for right panel.
Press Alt + P for input box where you have enter server name. Enter for instance
ftp.gwdg.de/pub
and press Enter.
Now mc will try anonymous connection to remote machine. If machine responds, you'll get directory listing of /pub on remote
server.
It is possible to do the same from mc command line by typing:
cd /#ftp:ftp.gwdg.de/pub
Happy browsing.
Archive browsing
Archive in classic meaning is compressed file. In Linux you can recognize them by suffix like:
tgz, tar.gz, tbz, tar.bz2
and many more, but above few are the most used
Highlight the file
Press Enter
That's it. Midnight Commander will decompress file for you and present it's internal structure like any other directory. If you
want to extract one or all files from archive mark what you want toextract and use F5 to copy in another panel. Done.
RPM browsing
The package installation files for any SUSE are
RPM and mc will let you browse
them.
Highlight the file
Press Enter
You'll see few files:
/INFO
CONTENTS.cpio
HEADER
*INSTALL
*UPGRADE
Browse to see details of your RPM.
The CONTENTS.cpio is actual archive with files, and if you want to see within:
Highlight the file
Press Enter
(You know the drill)
The *INSTALL and *UPGRADE will do what the name tells, but if you want only to extract one or more files from CONTENTS.cpio
than use F5 to copy them in the directory in the other panel.
PuTTY and line drawing
PuTTY is terminal application used to access remote computers running Linux via ssh (SSH
tunnels from Microsoft Windows see details). The line drawing in Midnight Commander, YaST and another applications that draw
lines using special characters can be displayed wrong as something else. The solution is to change settings:
menu: Window > Translation:
Received data assumed to be in which character set: UTF-8
Handling of line drawing characters: Use Unicode for line drawing
If that doesn't help, you may set this too:
menu: Connection > Connection-type string: linux
menu: Terminal > Keyboard > The Function keys and keypad: Linux
+ t r & ! t t
d Diff against file of same name in other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
if [ -f %D/%f ]; then # if two of them, then
diff -up %f %D/%f | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
else
echo %f: No copy in %D/%f
fi
D Diff current directory against other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
diff -up %d %D | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
fi
To define a macro, press Ctrl-R and then type out the keystrokes you want to be executed..
Press Ctrl-R again when finished..
You can then assign the macro to any key you..
like by pressing that key..
The macro is executed by: Ctrl-A and then the assigned key.
===========
The simple example is to delete all "=" [from current cursor - forward].
The <F4>=<Replace> function of mcedit is the basis of the macro.
So:
Ctrl-r
<f4> = <ca. 9 tabs> o l <enter>
<must key to remove prompt which Falsely announces '5 replacemnets made'>
Ctrl-r
=========
[Mar 14, 2016] Ctrl+w clears the editboxes and Meta+h triggers the history drop-down
You should first try to use export LANG=C mc that might help.
mc usually works out of the box on Xfce Terminal, the gnome terminal and xterm.
Midnight Commander works great with URxvt, the unicode version of rxvt.
Daryl Styrk, 3/1/09
Frank McCormick wrote:
> What's the best terminal for running Midnight Commander...it seems all
> the ones I try ( rxvt, aterm) can't handle the acsii drawing characters
> so the display is wierd.
I've never used Midnight Commander, but here is my notes on how I got the BBS's to display much better..
cd /usr/share/fonts/X11/misc
wget http://home.earthlink.net/~us5zahns/enl/vga11x19.pcf
mkfontdir
xset fp rehash
Maybe that will get you somewhere.. Hope this helps.
Daryl
Midnight Commander works great with URxvt, the unicode version of rxvt.
The Debian package I have installed is 'rxvt-unicode.' There are two other packages that may work as well, 'rxvt-unicode-light'
and 'rxvt-unicode-ml' (the latter for multilingual support). This is with Lenny.
[Dec 06, 2015] ALT+S or CTRL+S for file searching
My other tip:ALT+S or CTRL+Sfor file searching.
Allows searching for names - with wildcards: Example: CTRL+S then sy jumps to first file starting with sy CTRL+S then *sy jumps
to first file containing sy
Further presses of CTRL+S jump to next matching file
If your keyboard or terminal does not have function keys: ESC [num] does equivalent of F[num] Example: to exit mc hit ESC then
0 (same as F10) But why would you ever want to do that?
If you want specific editor for specific type of file, the config file 'mc.ext' provides the opportunity to bind a command
to the actions: Open ([enter]), View ([F3]) and Edit ([F4]).
You can have both: the build in editor at [F4] being a fall back in lack of X and your preferred GUI-editor on just hitting [enter].
That needs some shell-script skills.
Because other tools, for example crontab, are using it. Such tools may be used without X (for example from a virtual
terminal in single user mode for maintenance operations) or by user who has no running X instance (for example through su
-). So better keep EDITOR set to a text mode editor.
Run MC as usual. On the command line right above the bottom row of menu selections type
select-editor
This should open a menu with a list of all of your installed editors. This is working for me on all my current Linux machines.
[Dec 06, 2015] Lynx-like motion
On Sat, 2015-11-21 at 19:00 +0200, Kertész Zoltán wrote:
Hi :)
I'd like to share one tip regarding mc.
mc is the first program always to install on a new Linux, and the following setting is the first to make to mc once installed.
Navigate to Options/Panel options and there (on the top right) at Navigation tick "Lynx-like motion".
What this does it activates the navigation within mc with the four arrow keys (up and down the tree, left is out of and right
is into a folder). It is called Lynx-like motion as the Lynx text based browser has this - I have to admit - really intuitive
way of navigating.
It comes extremely handy on headless systems, speeding up getting around in mc. I found that this is really handy, try it and
see if you find it useful too :)
locate mc.keymap == nX
man mc -> seek keymap = nX
Where's mc.keymap ?
Following "man mc" the file is searched in below directories in the given order
1) ~/.config/mc
2) /etc/mc/
3) /usr/share/mc/
"Initially, Mignight Commander creates key bindings using keymap defined in the source code. Then, two files /usr/share/mc/mc.keymap
and /etc/mc/mc.keymap are loaded always, ..."
If on your system the file does not exist at any location, you should create one or take one from the source and modify it.
cheers, Frank
[Feb 09, 2015] If you put the program you want to test on the left (passive panel) and file that this program works with on the
right (active panel) you can have a shortcut for testing.
For example for Perl you can put the following command in the user menu:
perl %D/%F %d/%f
[Feb 09, 2015] There is the ScreenList functionality in MC bound by default to Alt-Prime(`)
Message: 1
Date: Thu, 1 Jan 2015 17:13:58 +0100
From: Jack Epps <[email protected]>
To: [email protected]
Subject: ScreenList functionality
Message-ID:
<CAM-zSBQ=AKSOSRmCz7AyAw0vKAPhinA7Kv0g=+P1Wq75L6gbMQ@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Hi,
there is the ScreenList functionality bound by default to Alt-Prime
(`) in the default mc.keymap:
ScreenList = alt-prime
Pressing the combination displays "Screens" dialog, which says
"Panels" in the actual listing.
How to add panels or screens?
--
Best Regards,
Jack Epps
[Jan 18, 2015] How can I create file in mc? shift+f4 not working
1/13/2015 | Andrew Samoilov
Hello,
Use F9 - Options - Learn Keys.
P.S. If Shift-F4 is move file for you, use Shift-F2
On Mon, Jan 12, 2015 at 3:30 PM, Mike Smithson <[email protected]> wrote:
Message: 2
Date: Wed, 24 Dec 2014 20:47:07 +0600
From: "Igor"
To: [email protected]
Subject: error or i don't understend some thing
Message-ID:
<CANxHswzE4u0Ty_f-oXSsmSozKUWHtYY2PLVoa9tViHdRC-
[email protected]>
Content-Type: text/plain; charset="utf-8"
hello, my name is Igor i have a question
how can i create file in mc? shift+f4 not working
now i using echo > flie.name in terminal mode(ctrl+o)
mc version 4.8.11
os ubuntu 14.04
shift+F4 is "move file" for me. If I want to edit a new file
I type "vim file" and hit enter. After that F4 will edit it if
it exists. "touch file" will also create new empty file (easier
to type than "echo > file).
--
Peace and Cheer
If the file command indetifies them as "XZ compressed data" then it
works out of the box (IIRC since version 4.7.0).
when I open mc, and navigate to a folder where there are compressed
files (for example, in *.tar.gz format), pressing enter on these
compressed files opens them temporarily.
If I do it on *.xz files, then garbage is displayed.
To "change into" such file it must contain an archive of a directory
structure, for example *.tar.xz. If the file *.xz contains only is a
single compressed file you can only view the uncompressed file
(pressing F3).
F9 -> C -> <extentions> shows me:-
# .tar.xz, .txz
regex/\.t(ar\.xz|xz)$
Open=%cd %p#utar
View=%view{ascii} xz -dc %f 2>/dev/null | tar tvvf -
.....
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$
Open=case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -
View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *)
... and more ...
Yes: good explanation.------
File: mc.ext Line 629 Col 1 16958 bytes 100%
# xz
regex/\.xz$
Open=xz -dc %f | %var{PAGER:more}
View=%view{ascii} xz -dc %f 2>/dev/null
===
-> which xz == /usr/bin/xz
So I'd expect: `xz -dc SomeFile.xz` to <show> the expanded file
in a terminal, and for mc to show via <F3>.
On 12/29/14, [email protected]<[email protected]> wrote:
Send mc mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://mail.gnome.org/mailman/listinfo/mc
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of mc digest..."
Today's Topics:
1. Re: opening *.xz files (basti)
----------------------------------------------------------------------
Message: 1
Date: Sun, 28 Dec 2014 14:49:03 +0100
From: basti <[email protected]>
To: [email protected]
Subject: Re: opening *.xz files
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hello,
I'm no expert but i would say this depends on the file which is compressed.
First of all you need xz-utils installed.
I can't open an xz compressed dd image in mc BUT
I can open an xz compressed text file in mc.
In /etc/mc or in ~/.config/mc is an mc.ext file which define the file
extensions handled by mc.
I hope that would help you.
Best regards,
Basti
Am 28.12.2014 12:43, schrieb Kevin Wilson:
Hi,
Is there a way to open *.xz files in mc ?
when I open mc, and navigate to a folder where there are compressed
files (for example, in *.tar.gz format), pressing enter on these
compressed files opens them temporarily.
If I do it on *.xz files, then garbage is displayed.
Any ideas ?
Regards,
Kevin
4>
[Jan 12, 2015] Re: mc on high resolution monitor with konsole
On Sat, 27 Dec 2014 16:11:34 -0800, Outback Dingo <[email protected]> wrote:
ive got a samsung 4k, running kde in the proper mode, however in konsole
when i launch mc
it only fills 1/3 of the screen... how can i get it to be full screen? ive
attached an image
How many $COLUMNS in that window? 500 or something? I thought I was getting
out of hand with 236 on 1920x1080. :)
Check F9-> Options -> Layout. It looks like mc is not expecting a super-wide
screen and thinks it's in 80 column mode or something. Note that with really
wide screen like that your scrolling may be slow. You may want to use smaller
terminal window, or much bigger font.
Also, sending SIGWINCH to mc may help fix it automatically: try un-maximizing
the window, then re-maximizing it. mc may adjust properly. Then SAVE the
options so it remembers for next time.
[Jan 12, 2015] Re: External editor with parameters not working?
I tried the following thing:
1) export EDITOR="emacs -nw"
2) mc
3) (with internal editor disabled) go to some file and press F4
This opens emacs with the file, however it does not open it in terminal (which should be done with -nw switch) but in new window
in X. (as if it somehow ignored -nw). If I run the following in shell:
$EDITOR file
it opens file as expected. Why does mc not do that?
I tried setting EDITOR to "vim -R" and again when run from mc, it does
not honor -R switch.
I have version 4.8.12 (which comes from Fedora 21 package).
Stevko
I am not subscribed to mailing list (so send replies also to me).
_______________________________________________
mc mailing list https://mail.gnome.org/mailman/listinfo/mc
Thanks frank. The answer was in front of my nose the whole time.
Environment variable MC_TMPDIR can be used to know that you're being
called from mc. For some reason MC_SID disappears but MC_TMPDIR does
not.
I needed something more specific than just knowing whether I'm
in pts or not. I want to know if it's mc's F4 EDIT command calling, or
at least being called from a terminal with mc running in it.
if [ -n "$DISPLAY" -a -n "$MC_TMPDIR" ]; then
# we're being called from mc in XWindow terminal
do_something_odd
fi
All shortcuts are noted in the menus. In mc's keyboard shortcut notation, 'C-x i' would mean press Ctrl and x simultaneously,
release both then press i. M refers to the Alt key. A few common shortcuts:
• Ctrl R - refresh or rescan directory view
• Alt-shift ? - find file
• Ctrl-x d - compare directories (release ctrl-x before pressing d)
• Ctrl \ - open directory hotlist
• Ctrl-x c (o,s,l) - chmod, chown, symlink, link
• Alt c - quick cd (opens a box, quicker to type than arrowing through if you know its full path)
• (Shift) + - select group. Can enter wildcards to highlight a certain type or name of file.
• (Shift) * - reverse selection. Changes highlighting to all unselected files. Handy to use these two in combination if
you are trying to quickly select all but a certain group.
• \ - unselect group. Opposite of +.
The command line
Although I don't use the command line much in mc, it should execute whatever you have typed into it. If you wish to su, it will
return you to the terminal to type in your password. Then relaunch mc as root; if you ctl-o, it will take you back as user.
While anything remains typed into the command line, the sideways arrow keys move through the text and won't work to navigate in the
panels. If your arrow keys suddenly don't work, check and clear the command line.
To scroll back and forth through command history, use alt - p for previous and alt - n for next command instead of the the up and
down arrow keys (as in the terminal window), since mc uses them for navigating.
I've recently built a couple of Debian 7.1 boxes and installed mc using the package manager, all works fine except that mouse
clicking at the top of the panel changes the sort order rather than scrolling up, as it used to.
I didn't even know you can use the mouse in mc.
I find this very confusing!
Not that I ever used it myself, but I'd argue that it's a common idiom. Clicking the table head reverses the sort order and the
mouse wheel is used for scrolling.
Marco
[Oct 28, 2013] mc startup with single specified path
I'm having some puzzlement over the initial startup behavior of mc-4.8.10 when paths are specified on the command line.
To quote the manual:
[quote]
If both paths are specified, the first path name is the directory to
show in the left panel; the second path name is the directory to be
shown in the right panel.
If one path is specified, the path name is the directory to show in the
active panel; current directory is shown in the passive panel.
If no paths are specified, current directory is shown in the active
panel; value of "other_dir" from panels.ini is the directory to be
shown in the passive panel.
[/quote]
Paragraph #1:
This seems correct and intuitive.
Paragraph #2:
What I *expect* to happen when I specify only one path on the command line, is for that directory to appear in the left
panel with the focus on it. As it works right now, it appears to be random which panel it shows up in, and which panel has focus.
I know that it depends on the last time I hit "Save Setup" and the setting of current_is_left in panels.ini, but it always seems
to do the wrong thing. As a matter of fact, the behavior I'm witnessing, is that that specified directory appears in the *inactive*
panel, and the CWD appears in the *active* panel. I think that is counter-intuitive, a bit annoying, and exactly *not*
what the manual says.
Paragraph #3:
This also seems correct and intuitive. Resort to default behavior if nothing is specified.
A:
Please start with looking around in the bugtracker or compiling the
development version next time :) The issue is already fixed for the
forthcoming 4.8.11.
[Oct 27, 2013] re: How to switch two -> single panel modes?
Hello.
Does anyone know how to hide the second panel in one keyboard hot key?
Currently, we may do this by pressing <M-t> three times and manually set
user_format (from "panels.ini") from
user_format=full name type size:4
to
user_format=half name type size:4
and vice versa.
Thanks.
I don't know of a way, but ALT-T seems to cycle through the Listing Modes:
Full File List
Brief File List
Long File List <-- this one is single panel
User Defined
This begs a question:
In my panels.ini I have this:
...
list_mode=user
user_format=name|size
user_status0=half type,name,|,size,|,perm
user_status1=half type,name,|,size,|,perm
user_status2=half type,name,|,size,|,perm
user_status3=name
user_status4=half type,name,|,size,|,perm
user_mini_status=1
...
What are these user_status[0-4] lines for? Apparently user_status3 is the format of the user_mini_status, but what are the others for? I can change them, but they don't seem to do anything.
I have a guess that they have something to do with this:
static const char *
panel_format (WPanel * panel)
{
switch (panel->list_type)
{
case list_long:
return "full perm space nlink space owner space group space size space mtime space name";
case list_brief:
return "half 2 type name";
case list_user:
return panel->user_format;
default:
case list_full:
return "half type name | size | mtime";
}
}
Perhaps sometime in the misty past, the user was allowed to define these himself, instead of being hard-coded. Come to think of it, that would be a nice feature.
What is funny is that the web page for Midnight Commander does
not have a link to a stable release. I am assuming that all releases are now unstable ;-). In reality the last (more or less) stable
version 4.8.1.7
Core:
Make copy/move progress dialog window wider up to 2/3 of screen width (#2076)
Ask file name before create new file in editor (#2585)
Support newer extended mouse protocol SGR-1006 instead of URXVT-1015 (#2956)
Allow skip directory scanning before file operation. Print directory count and size in addition to directory name (#2101)
Add jump support to target line in some external editors and viewers (#2206)
On Fri, 22 Feb 2013 20:16:17 +0200 Elad Rom wrote:
Is there a way to cd into a folder (be it ssh, ftp or local folders)
from an existing instance of midnight commander through a shell script?
Example:
Inside an open MC instance, in my home folder, there is a file called "somessh.sh".
When I hit enter on this executable, I want mc to cd into the directory I specify inside the file (E.g.
~/Downloads)
as if I'm using the cd in the mini-command line or via quick cd.
When you run shell script, you run new shell which is child process of MC.
When you do cd in the script, you change working directory of that child
shell. Working directory of parent is unchanged. You unable to change working
directory of parent from child.
You have to use the "source" built-in shell command to run script in current
process context. This allows you change current directory from script.
On Fri, 04 Jan 2013 18:48:09 +0000
frank <y199mp1505 gmail com> wrote:
In Midnight Commander, nlink is supposed to be the number of symlinks
to a file. So far so good.
hardlinks? You can't count amount of symlinks to a file without
probing every file on your filesystem to be a symlink on requested file.
Hardlinks to a new dir come from 2 nodes:
- '$your_dir/..'
- '$your_dir/.'
'stat -c%h /path/to/dir' should show the same value.
But I have created a new subdir '123456789' in my home directory for which I have to assume no symlinks exist.
Well, MC says nlink is 2 in this case. Where are those two symlinks?
In reality external diff can be implemented via user menu.
On Wed, 28 Nov 2012 19:42:47 +0100 Frank Dietrich wrote:
is it possible to configure an external diff tool?
I would like to use meld in case I need to diff a directory.
Current I do it like this
in panel1: cd ..
in panel2: cd ..
type command 'meld '
in panel2: CTRL-SHIFT-ENTER
in panel1: CTRL-SHIFT-ENTER
press ENTER to execute the command
I would like to reduce the number of steps needed to compare the two
selected directories without leaving them.
A: Read the "Macro Substitution" subsection in mc manual page.
Am Freitag, den 28.09.2012, 15:37 +0200 schrieb Carsten Richter:
Hi there,
When I am creating Symlinks in MC (using Ctrl-x s) i am spending quite
some time for replacing the absolute by the relative one and I was
wondering if it is possible to have the default path in the address line
to be the relative one.
Is there such an option or can it be implemented?
The excerpts above come from my IceWM Toolbar config file. mcg_01 denotes MC User's Icon (g for green, r for red). Do not forget
to install sudo application.
It suffices to make two aliases or scripts for the xterm (…) invocations:
mcu.sh:
#!/bin/bash
xterm -bg darkgreen -cr yellow -fg white -sl 1500 -e mc
mcr.sh:
#!/bin/bash
sudo xterm -bg darkred -cr yellow -fg white -sl 1500 -e mc
Cheers,
P2O2
[Nov 14, 2012] M-! allows to execute arbitrary Unix command and see output in built-in viewer.
[Nov 13, 2012] Compensating for deficiencies of built-in search with panelize command
No ability to search for files belonging to certain data range in available in built-in search in mc, but because script panelize
command is available Unix find can be used to compensate for this shortcoming.
Windows XP+/32 bit native port of GNU Midnight Commander, based on the current 4.8.4 development stream.
Midnight Commander (also known as mc) is a free cross-platform orthodox file manager and a clone of Norton Commander.
Features include the ability work with common archive formats as if they were simply another directory, and to function as an
FTP client. Midnight Commander also includes an builtin editor/viewer, features include syntax highlighting for many languages, macros,
code snippets, simple integration with external tools, automatic indentation, mouse support, clipboard and the ability to work in
both ASCII and hex modes.
Midnight Commander can also rename groups of files, 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.
[Nov 06, 2012] Mc allows one panel to be full screen and the other half screen. In this case tab essentially expands the other panel
to full screen
This is an interesting consequence of having wide mode and it is also present in FAR. I come across it quite accidentally testing
mc for compatibility with OFM1999 standard.
+ t r & ! t t
d Diff against file of same name in other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
if [ -f %D/%f ]; then # if two of them, then
diff -up %f %D/%f | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
else
echo %f: No copy in %D/%f
fi
D Diff current directory against other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
diff -up %d %D | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
fi
Multieditor: allow edit many files in one mcedit window (#2261,
#2839)
It would be nice if editor could open several files simultaneously in one window. Window could be split up vertically or
horizontally. And it would be perfect if one could use copy/move/paste functions (F5/F6) between these files without using
intermediate clipboard file ~/.mc/mcedit/cooledit.clip
by nevets (39138) writes: on Monday January 26 2009, @05:09PM (#26612777) Homepage Journal
I love mc!
I use it all the time for patch management. One little tidbit that most people do not know about mc
is that you can cd into a patch. Edit the diffs in the patch, and copy a diff from one patch to another patch file, just like copying
or moving a file.
Performing some operation on multiple files with the help of mc
Aye, that's a standard (and heavily used) feature here. it doesn't do much however for the "I want to run this command on
some arbitrary selection of those files" case.
mc can be used then, even though the order of operations is slightly different:
1: mc
2a: select files
2b: type the command
3: hit ctrl-x t<enter>
then F10 if you don't want to use mc anymore...
it has the same effect as you describe, it's a little bit less effective as far as typing goes (but not much) - it shouldn't matter
if you use it rarely, if you'd use it more often you would probably already
be in mc.
2a and 2b can be done in any order.
2a: there are several ways to select files you want to use:
insert tags/untags files
+ enables you to type in shell patter or regexp (configurable)
meta-? is a simple version of find+grep
ctrl-x ! let's you run any program that returns list of files (e.g.
find)
you do not have to use all the fancy file picking mechanizms, if you want to stay simple you can use insert and possibly +
3: you can edit the resulting command line before hitting enter (unfortunately not using your shell, it gets into shell history though).
you have to know the ctrl-x t spell though. then again, you have to know select if you want to use it so it's basically the same
(and there's context sensitive help in mc when you forget the keybinding).
note that while what I describe is somewhat complicated you can use it in very simple form, in that case it's basically the same
as select. the additional functionality does not stand in your way...
...
> Err, to repeat the point, I don't. File management is perhaps less > than 3% of my time, if that.
what I was saying is that I am not all the way on the other side (as you suggested). In fact if it weren't for mc I would probably
use file managers less than 10% (at least that was the case before I've found mc) and be quite happy.
...> > I don't get it. What is it that LIST does that mc does not?
> > Faster, smaller, lighter, more unobtrustive, easier/more-intuitive > cross-directory operations, default/expected key bindings, less > cruft. I don't want a swiss army knife. I just want a small fruit > knife.
smaller: yes (but who cares?)
faster: NO, see the timing of startup/exit below, and there doesn't seem to be any detectable speed difference during operation.
more unobtrusive: mc even let's you work in your shell, how can it be any less obtrusive? you can have nothing but panel on the screen...
intuitive: list is not intuitive at all, without using the help screen you wouldn't be able to do almost anything. 'c' does not copy.
v is for NV (arc viewer) [linux version, IIRC it is somewhat better in DOS
version] etc. mc is not anymore intuitive than that but at least it is easy to get help, it displays basic keys on the screen (if
you want it to) and lot of keys are the same as nc uses (which is/was sort of de
facto standard)
cross directory ops: linux list doesn't seem to have any. haven't find a way to copy a file (intuitive???). what I remember from
dos version is that it brings up dialog where you can type in the destination, which is exactly what mc does. mc provides the oposite
panel's directory as default but you can start typing your own destination right away so it doesn't slow you down at all, it even
provides auto-completion (meta-tab).
key bindings: list definitely does NOT provide expected key bindings, specially the linux version. the dos version - perhaps and
if you like those then that's a valid point against mc. still - you cannot change
them so how is it that you know what to expect when you hit r? is it remove or rename? intuitive?
the knife analogy is not a valid one in this case. the extra functionality of mc does not come at significant cost - the only difference
is that the program is bigger, it does not have almost any
difference on start-up time (that's the only possible difference). the HD space it takes up is not of concern (today and even less
concern in the future). How is the extra functionality of mc standing in your way? If you don't know about the extra keybindings
you simply don't use them.
What's the problem?
...
> >> mc enforces a UI which I find nearly unusable and supports a raft > >> of features that I find distracting from what I'm > > > ? every UI program enforces its UI. every CLI program enforces > > its UI as well. LIST does. not sure why you are singling mc out. > > Because I don't like mc's choices?
in one panel configuration it is basically the same as list...
...
> Silly examples: The may MC handles cross-directory operations is the > exact opposite of what I prefer. mc requires the other pane to be > on the target and the current pane to be the source. Aaaargh! That
(sort of repeated from above) no it does not. it just provides it as
default, you can immediately type in your own destination just as if the
default wasn't there. it even provides auto-completion. what more (or
less) do you want? how is list better than that?
> catches me almost every time. The second confirm/edit/etc step > under mc when doing a tagged file operation is something I've never > wanted (or used) and would really like to never see.
you get the same dialog in list. how else would you specify the
destination? it does not make any sense. what do you mean?
> ObNote: I'd also much prefer it if mc left me in the directory it > was viewing when I exited, rather than the directory I started it > from.
list or any other program does not do that either. and cannot. that's
why cd is internal shell command (child cannot change the parent process
environment, cwd etc.)
however, there's a sort of solution for this, here's a relevant quote
from man page:
-P At program end, the Midnight Commander will print
the last working directory. This function should
not be used directly, instead, it should be used
from a special shell function that will automati
cally change the current directory of the shell to
the last directory the Midnight Commander was in
(thanks to Torben Fjerdingstad and Sergey for con
tributing this function and the code implementing
this option). Source the files
/usr/lib/mc/bin/mc.sh (bash and zsh users) respec
tively /usr/lib/mc/bin/mc.csh (tcsh users) in order
to have this function defined.
> > you can fire it off anytime you want and quit it with single > > keystroke, it's not a monster that would take forever to start up: > > Arguably that's little different from list. > > > jojda:~>time mc > > $ time mc > real 0m0.469s > user 0m0.000s > sys 0m0.040s > > $ time list > real 0m0.098s > user 0m0.070s > sys 0m0.020s
I compiled the list (crowe's version for linux) and above are the
results on my machine. I would say that you cannot distinguish between
list and mc (as far as start-up time goes). Not sure how to measure
anything else but from visually judging the speed I don't think there's
any significant difference.
btw on your computer it says that real time was 0.469s while the sum
of other times was a lot less - that means that there was something else
going on on the system. Or perhaps it was waiting for a disk to load the
file (mc itself, that would mean that you'd have to wait for about .5s
when you start mc first time/after a very long time - that's not such a
big deal). Since I already ran mc I obviously cannot test the first
start right now...
> No promises on not having a slow finger, tho I tried not to. > > > you can even run it with command line, it's not some internal > > funky CLI, it's your login shell, basically unchanged, you just > > hit ctrl-o to make panels disappear (but you _don't_ _have_ to use > > this feature, you can just quit mc or use ctrl-z) > > I like the bash command line and want it to be my default CLI UI.
good. as far as comparison between list and mc goes: mc is basically
the same but provides you with you shell even from within mc (and yes,
it's bash shell (or whatever your login shell is), not some internal
funky shell).
> Nothing else, just bash as configured by my .bashrc, under an xterm > as configured (and keys re-bound) as per my .Xdefaults. I like > that and would like to stay with it, augmenting it only in the areas > mentioned, not replacing or changing large chunks of it.
OK. that's what I do as well. whether you augment it using list or
using mc there's no difference in obtrusiveness, I would argue that mc
is less obtrusive because it lets you use you shell even when you run mc
(again, this functionality does not come at a price - if you don't want
it just don't use it, it does not prevent you from using ctrl-z or quite
mc etc.).
> > also: menu bar, command line, status line, hint line can all be > > turned off so you're left with panel(s) only. > > I'd rather (almost always) have visible the bottom end of scrollback > (usually the last 20 or 100 lines depending on window size, with a > further 5K lines available under PgUp/PgDn)). That I find useful > and use dozens of times a day. The vast majority of the time I > don't have a use for the panes.
so at those time do not run the file manager or use ctrl-o with mc (or
ctrl-z), that's what I do as well. have an xterm, sometime run mc in it,
depending on what I do. when I want to use command line again (in the
same xterm) I either quit mc or use ctrl-o (depending on what I think I
will be doing).
ctrl-o has an advantage of keeping the directories of shell and mc in
synch - if you are in mc and change directory the shell's cwd changes as
well, if you hit ctrl-o and cd in shell the mc's cwd changes too (that
wouldn't happen if you used ctrl-z). again: you do not have to use this
feature and it doesn't cost you anything... IMO it makes perfect sense,
specially for people who do significant amount of work using command
line but that's just me - you might not find it useful and you do not
have to use it (or even know about it). it's not forced on you.
> > mc is not an integrated solution. > > We disagree.
how is mc more integrated solution than list? you can use it in the
same way that you use list (in principle, it's, of course, not exactly
the same).
> Stylistically I'd prefer something that handled mail far closer to > the way MH approaches handling mail than the way that any of the > mbox-based tools do.
what is this about? and BTW as far as email goes the best way to store
it is to use IMAP (which IIRC is what you do, or at least advocate).
> >> Hurm. John Crowe's list (OSS) seems a fairly good starting > >> point. Its got most of the basic supports there already. I > >> really should take some time off and just hack it into shape. > > > he recommends mc as well:-) just checked the web page. > > Yeah, I know. > > > the more you're explaining the more I find your position strange. > > everything that you write (apart from keybindings configuration) > > points to mc. yet you don't like it. is it something personal? > > Nope, just what I've written.
but based on what you've written you want mc! (overall, apart from the
keybindings) I am quite confused - what you're saying about how you work
makes sense (I work in similar way even though not on the same kind of
tasks) but when it comes to mc you're suddenly strange... well, one way
or another, I guess that's it from me, I hope you didn't find it too
pushy... (=unless you want to continue discussion I am not goin to
continue with my mc evangelism).
Although Midnight Commander is a text mode application it can make use of mouse. The openSUSE delivered mc will make use
of the mouse when used with a GUI console, without any
further configuration needed.
The text mode terminal that we get when booting in
runlevels 2 or 3 is a bit different
story. You have to install the package
gpm ("general purpose mouse") which is also called mouse server. The gpm is used in Linux to receive movements and clicks
from mouse. Start gpm and then start Midnight commander.
If you come to the text terminal using Ctrl + Alt + F1, then
gpm will not work as another driver
that belongs to GUI (X
Server) claims control over the mouse.
Lynx like motion
This is browsing using the cursor keys. You have never seen graphical applications (like Konqueror) run this fast through directories.
openSUSE 11.4 and later
Main difference to older versions of Midnight Commander is different menu, so now we need Panel options instead of
Configuration.
To enable it
Press F9 to select drop down menus on the top of the screen.
Press Alt + o or move highlight with cursor keys for left or right to the Options, then press arrow down, to get
drop down menu with options.
Press arrow down to select Panel options and Enter key to open window with setup
Press arrow down until you have selected [ ] Lynx-like motion, or , or ALT + y to jump directly.
Press Space to check option. It will show [x] Lynx-like motion if it is active (enabled)
Press Alt + s or move highlight to the [ Save ] and press Enter to save setting.
openSUSE 11.3 and earlier
To enable it
Press F9 to select drop down menus on the top of the screen.
Press Alt + o or move highlight with cursor keys for left or right to the Options, then press arrow down, to get
drop down menu with options.
Press Alt + c or Enter to get dialog window Configuration with options.
Now don't use key shortcut, but use cursor key to move highlight to [ ] Lynx-like motion option,
Press Space to check option. It will show [x] Lynx-like motion if it is active (enabled)
Press Alt + s or move highlight to the [ Save ] and press Enter to save setting.
FTP browsing
This is file browsing on remote FTP server just as it is on your computer.
Press F9 to select drop down menus on the top of the screen.
Press Alt + L if you want to use left side panel, or Alt + R for right panel.
Press Alt + P for input box where you have enter server name. Enter for instance
ftp.gwdg.de/pub
and press Enter.
Now mc will try anonymous connection to remote machine. If machine responds, you'll get directory listing of /pub on
remote server.
It is possible to do the same from mc command line by typing:
cd /#ftp:ftp.gwdg.de/pub
Archive browsing
Archive in classic meaning is compressed file. In Linux you can recognize them by suffix like:
tgz, tar.gz, tbz, tar.bz2
and many more, but above few are the most used
Highlight the file
Press Enter
That's it. Midnight Commander will decompress file for you and present it's internal structure like any other directory. If
you want to extract one or all files from archive mark what you want toextract and use F5 to copy in another panel. Done.
RPM browsing
The package installation files for any SUSE are
RPM and mc will let you
browse them.
Highlight the file
Press Enter
You'll see few files:
/INFO
CONTENTS.cpio
HEADER
*INSTALL
*UPGRADE
Browse to see details of your RPM.
The CONTENTS.cpio is actual archive with files, and if you want to see within:
Highlight the file
Press Enter
(You know the drill)
The *INSTALL and *UPGRADE will do what the name tells, but if you want only to extract one or more files from CONTENTS.cpio
than use F5 to copy them in the directory in the other panel.
PuTTY and line drawing
PuTTY is terminal application used to access remote computers running Linux via ssh (SSH
tunnels from Microsoft Windows see details). The line drawing in Midnight Commander, YaST and another applications that draw
lines using special characters can be displayed wrong as something else. The solution is to change settings:
menu: Window > Translation:
Received data assumed to be in which character set: UTF-8
Handling of line drawing characters: Use Unicode for line drawing
If that doesn't help, you may set this too:
menu: Connection > Connection-type string: linux
menu: Terminal > Keyboard > The Function keys and keypad: Linux
+ t r & ! t t
d Diff against file of same name in other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
if [ -f %D/%f ]; then # if two of them, then
diff -up %f %D/%f | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
else
echo %f: No copy in %D/%f
fi
D Diff current directory against other directory
if [ "%d" = "%D" ]; then
echo "The two directores must be different"
exit 1
fi
diff -up %d %D | sed -e 's/\(^-.*\)/\x1b[1;31m\1\x1b[0m/g' \
-e 's/\(^\+.*\)/\x1b[1;32m\1\x1b[0m/g' \
-e 's/\(^@.*\)/\x1b[36m\1\x1b[0m/g' | less -R
fi
[Sep 28, 2012] Midnight Commander Guide
Everything is nice but implementation of third (command line) window remains completely screwed in Midnight Commander. This is the
key OFM feature that Miguel de Icara never understood and we are still paying for that.
It'll have a bunch of LaTeX formatting interspersed with the text, but much of it should be readable.
-- Be careful about reading health books. You may die of a misprint. - Mark Twain
Guus Bonnema:
Man, this rocks! Excellent job. Many problems and solutions discussed plus a lot of tips.
And I like the presentation. I am proud to see LaTeX still leads to beautiful products.
Natalie
...Maybe you could add that the copy and move dialogs (F5 and F6) have a very useful history. With
Alt-H you get a list of dirs that you have used earlier to copy or move to. Clicking with the mouse on the [^]
at the end of the input line has the same effect.
xxx
Carsten Richter wrote:
> Nice work, there are some key bindings which don't work here, maybe due to my
> terminal emulator (such as Alt-'). But for sure Ctrl-I doesn't redraw
> the display wenn it's messed up. I need to do the Ctrl-o twice.
It's Alt-` (backtick) and Ctrl-l (lowercase L). That should work.
there are some key bindings which don't work here, maybe due to my terminal emulator (such as Alt-'). But for sure Ctrl-I doesn't
redraw
As someone pointed out, it's a backtick and Ctrl-L. I'll see if I can conveniently change the font where those key bindings
are listed...
the display wenn it's messed up. I need to do the Ctrl-O twice.
Ctrl-L is somewhat common and good to remember. I think a bunch of other Linux programs
use it.
I also would like to know how to change the default keybindings. I was able to change the autocompletion keybinding in an old
mc using the "learn keys" option. But with never ones it's not working apparently.
I'm pretty sure there's a way - you'll find it in the release notes for some release in the last 2-3 years. I think I once
found some places that describe how to change them, but it seemed quite painful. I only really wanted it to be able to
sort files rather than having to go to the menu - but then they allowed sorting by clicking the headers, and that sufficed.
-- Heard the one about the dyslexic devil worshiper? He sold his soul to Santa.
Hallo, mailinglists:
there are some key bindings which don't work here, maybe due to my terminal emulator (such as Alt-?). But for sure Ctrl-I
doesn't redraw
As someone pointed out, it's a backtick and Ctrl-l. I'll see if I can conveniently change the font where those key bindings
are listed...
Helmut:
Just additional: sometimes (especially with some remote terminals) the function keys don't work. But (p.e.) esc 3 instead of f3seems still to work.
> Please, a small question - I made the new installation (FC3, KDE)
> and run MC (the great SW!!). Everything works, except that borders on
> the panels are drawn by 'a umlaut' instead of pseudo-graphic (lines)
This is a locale and termcap issue which I do not fully understand.
Fortunately I do know a workaround. :) Use this:
So far I've been able to change the color of text, but not the default, blue background.
jayeola@tp20$ mc -V
GNU Midnight Commander 4.6.1a
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, smbfs, undelfs
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Data types: char 8 int 32 long 32 void * 32 off_t 64 ecs_char 8
u can use from 0/0/0 to F/F/F afaik, then restart X
On Friday 25 February 2005 07:49, Duane Frederici wrote:
I'm running SuSe 9.0 and when I exit MC with F10.....I return to my home directory. Under Red Hat
when I exit MC with F10 it is the last directory I was in, in MC......can I make MC under SuSe 9.0
behave the same way and if so how?
I do not want to return to my user home directory when exiting MC....I want to stay in that current directory.
MC is at level 4.6.0
Thanks for the help,
> MC......can I make MC under SuSe 9.0 behave the same way
Yes.
> and if so how?
"mc" is probably a shell alias:
$ alias mc
alias mc='. /usr/share/mc/bin/mc- per.sh'
(This is bash in Slackware.)
Simply set the alias in your shell. You probably have the mc- per.sh
script there somewhere; if not, just copy it from the RH box.
> Please, a small question - I made the new installation (FC3, KDE)
> and run MC (the great SW!!). Everything works, except that borders on
> the panels are drawn by 'a umlaut' instead of pseudo-graphic (lines)
This is a locale and termcap issue which I do not fully understand.
Fortunately I do know a workaround. :) Use this:
LANG=C mc
to start mc.
Way to make F6 put the current name on the input line for editing (renaming)
Q: [Felix Miata]:
Surely there must be some way to make F6 put the current name on the
input line for editing (renaming) instead of moving to some other
location, but I am at a loss to find it. I'm really tired of retyping
complete filenames. Someone please tell me how to easily just add or
deleting one character in a filename.
A[Pavel Roskin]: Shift-F16 (in the latest versions). Also, file completion (Escape-Tab) works in the rename dialog, which makes it
easy to rename to any exisitng filename.
Pavel Roskin wrote:
>
> On Fri, 2005-03-04 at 14:53 -0500, Felix Miata wrote:
> > Surely there must be some way to make F6 put the current name on the
> > input line for editing (renaming) instead of moving to some other
> > location, but I am at a loss to find it. I'm really tired of retyping
> > complete filenames. Someone please tell me how to easily just add or
> > deleting one character in a filename.
>
> Shift-F16 (in the latest versions).
I don't have any F16 key. :-P F6 tries to move. Shift-F6 doesn't do
anything at all where most needed, on tty[1-6].
> Also, file completion (Escape-Tab) works in the rename dialog, which
> makes it easy to rename to any exisitng filename.
This is unintuitive and doesn't seem to work right. When I try esc-tab,
it brings up a list of local files. If I pick one, it pastes it in front
of the proposed path to move to that came up with F6.
-- "In everything, do to others what you would have them do to you." Matthew 7:12 NIV
/etc/mc/mc.ext file are some entries for common file types.
Date: Sun, 19 Dec 2004 22:30:03 +0100
From: Frank Dietrich
Subject: Re: ENTER key behavior
In-reply-to: <[email protected]>
Sender: [email protected]
To: [email protected]
Errors-to: [email protected]
Original-recipient: rfc822;[email protected]
Hi Andras,
"Andras Varga" wrote:
> Almost, but not really. I expect MC to launch the program which is
> registered for that file in the KDE (or GNOME) mime database. Why
> should I have to duplicate that information manually in MC...?
No. You don't have realy to duplicate it.
In the /etc/mc/mc.ext file are some entries for common file types.
e.g. PDF
-----------------------------------------------
# PDF
type/^PDF
Open=run-mailcap application/pdf:%f &
-----------------------------------------------
This entry start your default application for this mime type.
> In Windows, the feature works like this: it uses the "start" command
> (of cmd.exe) which "opens" the file (or folder) as if I'd
> double-clicked it in the Explorer.
'start' does the same thing under Windows as run-mailcap will do under
Linux.
> OFF: Also a good thing in Windows is that "start ." (or "start
> any-directory") opens the folder in Explorer. I also miss that on
> KDE, where I have to type "konqueror ." (or is there a "start"
> equivalent)?
Do you wan't to have only one command to do all the above magically
for you? Write your own. ;-)
Create an script named 'start', place it in a dir in your binary
search path and make it executeable.
--- start ------------------------------------
#!/bin/sh
if test -d "$1"
then
nautilus "$1"
else if test -e "$1"
then
run-mailcap "$1"
else
echo "Can't find directory or file: '$1'"
fi
fi
-----------------------------------------------
Nautlius is a Gnome filemanager. I don't know what you should use
under KDE. May be konqueror will do the same.
start . - opens nautilus in the current dir
start /var/log - opens nautilus in the /var/log dir
start /docs/test.pdf - opens the test.pdf in the dir /doc
with the default mime application
for PDF documents
regards
Frank
_______________________________________________
Mc mailing list
http://mail.gnome.org/mailman/listinfo/mc
The Last but not LeastTechnology is dominated by
two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt.
Ph.D
FAIR USE NOTICEThis site contains
copyrighted material the use of which has not always been specifically
authorized by the copyright owner. We are making such material available
to advance understanding of computer science, IT technology, economic, scientific, and social
issues. We believe this constitutes a 'fair use' of any such
copyrighted material as provided by section 107 of the US Copyright Law according to which
such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free)
site written by people for whom English is not a native language. Grammar and spelling errors should
be expected. The site contain some broken links as it develops like a living tree...
You can use PayPal to to buy a cup of coffee for authors
of this site
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or
referenced source) and are
not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society.We do not warrant the correctness
of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be
tracked by Google please disable Javascript for this site. This site is perfectly usable without
Javascript.