Softpanorama

Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
May the source be with you, but remember the KISS principle ;-)
Bigger doesn't imply better. Bigger often is a sign of obesity, of lost control, of overcomplexity, of cancerous cells

Cheetsheet for Midnight Commander

News Midnight Commander Recommended Links Recommended Papers OFM Book OFM Standards OFM Standard 1999
mcview Mcedit MC Macro Substitution MC Context Sensitive User Menu External panelize MC Extension menu  
Cheetsheet color scheme Editor syntax highlighting  FTE MC History Tips Etc
  1. Starting Midnight Commander
  2. Navigational and basic hot keys
  3. Command line and shell window
  4. Function Keys
  5. Tree View Panel
  6. Directory Search Panel (aka NCD panel, aka FindFolder)
  7. File/Directories selection/deselection
  8. Quick view
  9. Quick search
  10. FindFile
  11. Command line execution
  12. Sorting directories
  13. User menu script invocation
  14. Additional file commands
  15. Association (extension menu) management
  16. Compare directories
  17. Compare files operation
  18. Built-in Editor
  19. Archive virtual file system
  20. Infopanel and infoline
  21. History and favorites

Starting Midnight Commander

Open console and type on command prompt:

mc

and press Enter.

There are other ways to start mc. If you enter a directory, it will open in that directory

mc ~/.mc

will open the current directory and ~/.mc

mc ~/.mc /usr/share/mc

will open ~/.mc and /usr/share/mc

The first directory will be in the panel you were in the last time you opened mc. e.g. if you left mc with the right panel selected, mc ~/.mc /usr/share/mc will open /usr/share/mc on the left and ~/.mc on the right.

Navigational and basic hot keys

Notes:

Command line and shell window

Function Keys


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

Midnight Commander Cheat Sheet

Give Me Fish, LLC - Cross-platform C++, Scientific and Technical Programming
Midnight Commander Cheat Sheet
==============================

Ctrl-o	 Toggles to/from cl environment
Ctrl-t	 Toggles a file onto/from the "tagged list"
Ctrl-r	 Refresh both views
Ctrl-l  Reformats the screen (I often need to after opening external files
                           such as PDFs, which cause MC to display strangely.)
Ctrl-u  Swap lhs and rhs panels

Other panel views:
Ctrl-x q    Toggles other panel to/from "quick view". Views text.
Ctrl-x i    Toggles other panel to/from "info view". Views file info.
F3	    Toggles to full panel view of text file.
Ctrl-x t    Copies/pastes the currently selected filename(s) to the cl
            [Effective for using svn commands w/multiple files]
Alt-enter   Copies currently highlighted file to the cl
Ctrl-+	    Prompts for a reg-ex string and selects files based on it
Ctrl-*      Selects all files in cwd
Ctrl-x p    Copies the current directory to the command line 
Ctrl-x s       Creates symlink of the file you're currently on (defaults to
            placing that symlink in the dir in the opposite panel).
Alt-p	    Brings to the CL the previously issued command-line within MC
Alt-n	    Brings to the CL the next issued command-line command within MC
Alt-c	    Allows you to cd while preserving whatever is on the CL
Ctrl-\	    Gets you to hotlist
Esc-tab     Completion for command line (like Bash autocomplete)
Alt-i       CD's the other panel to the current panel's CWD
Alt-o       CD's the other panel to directory you are currently highlighting
cd -        On the command line, type "cd -" to return to the directory you
            were previously in. This is very handy if you accidently change
            directories (eg, sync other pane to same dir as current pane)

Hit return when on an archive library (libMylib.a) and see what object files
  have gone into creating the library.

In order to get a pane as an FTP directory, at the MC command line, type:

cd /#ftp:mpeavy:PASSWORD@teghis.pair.com         NOTE: PASSWORD is not encrytped
cd /#ftp:mpeavy@teghis.pair.com                  To be prompted for your password (still not encrytped)
cd /#ftp:mpeavy@teghis.pair.com/home/peavy       NOTE: gets you to your home dir directly.

**BETTER** - use scp / sftp instead:

cd /#sh:mpeavy@teghis.pair.com/home/peavy       Secure. Also, starts in home

The above ftp/sftp locations can be added to the hotlist.
In configurations, can set to not show backup (~) files.

--------------

Use the External Panelize functions to filter and perform external
 commands multiple times, eg, to view all header files.

Ctrl-x !     - Enter the External Panelize input screen. Choose a command or type
            another command to be executed. 
            Eg: find all header files with:    find . -name *.h
            Save oft-used commands for re-use.
            Will save the output results in the panel you were in.
            To refresh the panel back to the orig. dir view, refresh: Ctrl-r

--------------

Colors (Background, foreground, and transparency)
  http://plug-and-pray.blogspot.com/2009/09/editing-midnight-commanders-color.html
http://my.opera.com/kurzon/blog/2009/08/08/midnight-commander-col

???

Key Action
Ctrl+o toggle panes on/off
Ctrl+l redraw screen
Ctrl+PgUp goto parent dir
Ctrl+Enter copy selected filename to command line
Ctrl+x+p copy unselected panel's path to command line
Shift+mouse select text
Insert toggle selection of highlighted file
'*' toggle selection
'+' add pattern to selection
'-' remove pattern from selection
F3 view
F4 edit
F5 copy
F6 rename
F7 mkdir
F8 remove
F9 menu
F10 Exit
Open directory menu CTRL + \ CTRL + D
Compare directories CTRL-X + D SHIFT + F2
Rescan (refresh panel contents) CTRL + R F2
Hide panels CTRL + O SHIFT + ESC
Reverse selection M + * NUM *
Find file ALT + ? ALT + F7
Quick view CTRL-X + Q CTRL+Q
Change file and directory rights - chmod Ctrl-X + C n. a.
Change file and directory owner - chown Ctrl-X + O n. a.
Make symlink Ctrl-X + S SHIFT+CTRL+F5

CTRL-X + D sequence must be issued by pressing together CTRL and X, and then D button - like in Emacs editor. A shortcut which should be mentioned here is ESC+0,1,2…9 which replaces all function keys F1 to F10. It is indispensable in terminals which do not support F1-F10 buttons.

...

midnight-commander-mc-guide-powerful-text-based-file-manager-for-unix

Section 1 – Menu bar: Located at the top of the screen and has the following options. Press F9 (or) Esc 9 to access the menu bar.


Section 2 – Directory panels: Located in the middle and occupies large part of the screen. By default, it displays both left and right directory browsing panels, where you can view contents of two different directories at the same time.

Section 3 – Function keys: Located at the bottom and has following options. Press Esc key followed by the corresponding menu number to access these functions.

  1. Help – Display in-built mc help.
  2. Menu – Displays user defined menu items. You can create custom menu item to execute some complex steps of operations on the selected file. for e.g. compress the selected file and copy to a remote server with a single click. To edit the menu item file, click F9 (invoke menu bar) -> Command -> Edit Menu File
  3. View – View the selected file content using mcview, a viewer for midnight commander.
  4. Edit – Edit the selected file using mcedit, an editor for midnight commander.
  5. Copy – Copy the selected file. If both panels are displayed, it will copy the file to the other panel. mc will ask for confirmation before doing any changes such as, copy file, delete file, move file etc.,
  6. RenMov – Move/Rename the selected file.
  7. Mkdir – Create a new directory under the selected directory.
  8. Delete – Delete the selected file.
  9. PullDn – This will highlight the Menu Bar. This option is helpful when F9 doesn't work to invoke the menu bar.
  10. Quit – To quite midnight commander, press Esc key followed by 0.


Section 4 – Command Line prompt: Using midnight commander does not take away the command line from power user. You can start typing an Unix command anytime and press enter to execute it. Command line prompt is located towards the bottom of the screen.

3. Basic keyboard shortcuts

Most of the mc keyboard shortcuts fall in one of the following category:

Following are some basic keyboard operation

4.Sample mc usage scenarios

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Midnight Commander Cheat Sheet from Give Me Fish, LLC



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least


Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

 

FAIR USE NOTICE This 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 make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

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 author present and former employers, SDNP or any other organization the author may be associated with. 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.

Last modified: September, 12, 2017