- Midnight Commander – A Console Based File Manager for Linux
- What is Midnight Commander
- How to Install Midnight Commander in Linux
- Midnight Commander Features
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Midnight Commander Binaries
- Debian and Ubuntu
- Redhat-based distros
- Midnight Commander (Русский)
- Contents
- Установка
- Дополнительные темы
- Usage
- Interface
- Modules
- Configuration
- extfs
- Советы и рекомендации
- Переназначение сочетаний клавиш
- Навигация стрелками
- Запуск из меню
- Поддержка корзины
- Использование libtrash
- Решение проблем
- Выход в текущий каталог
- Искаженное изображение
- Opening files
- Find file shows no results
Midnight Commander – A Console Based File Manager for Linux
When you work with a lot of files on console environment such as moving files or copying files, you may find that your job is tedious. On the GUI environment there is a File Manager. File Manager will help you and speed up your activities associated with the files. You don’t have to remember every syntax / command associated with the files. Just click and drag or press shortcuts to complete your job.
Midnight Commander File Manager
In console environment, you have to remember commands / syntax. Luckily, Linux has a text based File Manager that works on console environment. The name is Midnight Commander (later we call it MC).
What is Midnight Commander
The Midnight Commander website says:
“GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It’s a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included”
How to Install Midnight Commander in Linux
By default, MC is not installed on a Linux machine. So you need to install it first. On Debian, Ubuntu and Linux Mint you may use this apt-get command:
On RHEL, CentOS and Fedora, you may use this command:
After installation is finished, just type “mc” (without quotes) from console to run it.
Main Window
Midnight Commander Features
MC has many features which are useful for a user or a Linux Administrator. Here’s some features that may be useful for daily basis.
Copy, Delete, Rename / Move, Create Directory
MC is divided into two columns. Left column and right column. Those columns are independent window from each other. Each window will represent an active directory. You can switch between window using the Tab button. At the bottom, you will see there are buttons which prefixed by a number. Those numbers represent F1 – F10 buttons.
To copy file(s) from one directory to another, simply highlight the file and press “F5” key. If you want to copy multiple files, you need to press “Insert” button for each file you want to copy.
Copy Files
MC will ask your confirmation about destination folder (To), Follow links, Preserves attributes. Generally, you can only focus on the To parameter. Just press OK to commit copy process.
Deleting file(s) is easier. Simply highlight the file(s) and press “F8” key to confirm deletion. Moving file(s) can be done using “F6” key.
Renaming file in other hand is different. When you press “F6” key, you need to make sure that you add a “New Filename” for the file in To parameter. Here’s a screenshot when you want to Rename a file.
Move Files
To create a directory, you can press “F7” key. MC will create a new directory in the current directory. For more details about what MC can do with the files, press “F9” > File.
File Menu
Internal Viewer
In console mode, there are many text editors such as vi, joe, and nano. MC has its own internal viewer. If you want to view the content of a file text, you can highlight the file and press “F3” key. You also can edit the file when you need. Highlight the file and press “F4” to start editing.
When you run the text editor for the first time, MC will ask you to choose default text editor for you. Here’s a sample output:
Then when you press “F4” button to edit a file, MC will use the text editor that you have chosen. If you want to change your default editor, just press “F2” button, choose ‘@’ sign and type ‘select-editor’ (without quotes).
Select Editors
What if you want to use other text editors that are not detected by MC? Let say you want to use Vi text editor. For this case, you can do it another way. In your home directory you will find a “.selected_editor” file. This is a hidden file, so it begins with a dot sign. Edit the file. You will see:
File Pemission
Files and directories have permissions. Permission will manage who can read, write an execute the files and directories. The command to manage it is chmod. You can see how to use chmod in details by typing “man chmod” in the terminal.
With MC, you only need to select a file then press “F9” > File > Chmod or press “Ctrl-x” and “c“. MC will show to you the current permission of the selected file and show to you more parameters that can be set.
Chmod Command
File Owner
Files and directories also have owner and group owner. The privileges of these owners are managed by chmod command above. The command to manage owner is chown.
As usual, you can see how to use chown in details by typing “man chown” in the terminal. With MC, you only need to select a file then press “F9” > File > Chown or press “Ctrl-x” and “o“. Now you can set owner and group owner from the available list of user name and group name.
Chown Command
MC also has Advanced Chown. It’s a combination between chmod and chown. You can do 2 different tasks in 1 place. Press “F9” > File > Advanced Chown.
Advanced Chown
FTP Link
By default, MC will show you 2 column interfaces. Left and right. Those columns are not only for local directory. You can make one of them or both connected to remote computer using FTP link.
In this case, MC will act as a FTP Client. To connect it into FTP service, you need to press “F9” > FTP Link. MC will ask credential of the FTP. The credential format will be like this:
Ftp Link Connection
If it’s correct, then the column will show you directories on the remote computer.
FTP Link
To disconnect your FTP link, you can press “F9” > Command > Active VPS Link. In the Active VFS directories list, you will see your FTP link. Choose your FTP link and press “Free VFSs” now. If you only want to switch to local folder without disconnecting the current FTP link, choose Change to.
Disconnect FTP
If your network using proxy server, you can configure MC to use FTP proxy. Press “F9” > Options > Virtual FS > Always use ftp proxy.
FTP Proxy
Leaving Midnight Commander
To leave Midnight Command, press “F9” > File > Exit. Or just press “F10” to quit. There are still a lot of features inside Midnight Commander.
For more details on MC features, please visit Midnight Commander FAQ at:
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Midnight Commander Binaries
While normally binaries are provided by distributions who choose to ship mc along with their packages, we do provide binaries for several most popular distributions, mostly for reference and testing purposes. However, please be warned, that we do not offer any support for these. If you encounter any problems, you are generally going to be asked to rebuild the sources from current git master and check whether the problem is already fixed or not. Another rule of thumb is to always use search before opening new tickets.
Debian and Ubuntu
Binary and source packages for:
- Debian Stretch (i386, amd64, armel, armhf, arm64)
- Debian Buster (i386, amd64, armel, armhf, arm64)
- Debian Bullseye (i386, amd64, armel, armhf, arm64)
- Debian Sid (i386, amd64, armel, armhf, arm64)
- Ubuntu Trusty (i386, amd64, armhf, arm64)
- Ubuntu Xenial (i386, amd64, armhf, arm64)
- Ubuntu Bionic (i386, amd64, armhf, arm64)
- Ubuntu Focal (amd64, armhf, arm64)
- Ubuntu Hirsute (amd64, armhf, arm64)
Release
Nightly
Repository is signed with PGP key 0x776F2A248D76B064, fingerprint: F6DE 7A3E D638 7B13 0F55 E6FF 776F 2A24 8D76 B064.
To install repository signing key execute:
or install tataranovich-keyring package from here.
You can track the package development here.
Redhat-based distros
There are some unofficial stable RPMS for Fedora, CentOS and Scientific Linux.
Источник
Midnight Commander (Русский)
Перевод этой статьи или раздела не отражает оригинальное содержание.
Midnight Commander — графический файловый менеджер, позволяющий копировать, перемещать и удалять файлы и деревья каталогов, производить поиск по файлам и запускать команды в командной оболочке. Он включает в себя встроенный просмотрщик и редактор файлов.
Midnight Commander имеет графический интерфейс, который отображается в текстовом режиме. Он работает в обычной консоли, внутри терминала X и через SSH-соединение на всех видах терминалов.
Contents
Установка
Последняя нестабильная версия доступна в пакете mc-git AUR .
Дополнительные темы
- mc-solarized-git — Цветовая схема Solarized
https://github.com/nkulikov/mc-solarized-skin || mc-solarized-gitAUR
- mc-skin-candy — Цветовая схема Candy
https://github.com/izmntuk/archiso/blob/master/configs/alter/root-image/usr/share/mc/skins/candy.ini [устаревшая ссылка 2020-08-04] || not packaged? search in AUR
Usage
The below section provides a short overview on usage of Midnight commander. References to mc(1) and the Help function ( F1 , available in every dialog) are made in this article as Section .
Interface
In prominent view are two vertical panes. Either can list directory contents, show a plain text preview, file details, or a directory tree (see Directory Tree ). File operations are accessible through the function keys or the mouse. More options are visible in a dynamic user menu ( F2 ) and option menu ( F9 ). Keys above F12 ( F13 up to F20 ) are accessible through Shift . Menu and dialog options have one letter highlighted — pressing this letter (or Alt+Letter inside a text entry) directly activates the respective option.
Below, a command line is visible, connected to a subshell. This shell is generally of the same type mc was launched from, and may be switched to at will ( Ctrl-O ), see The subshell support . On this command line, cd is interpreted by Midnight Commander, and not passed to the shell for execution. As such, special completion (such as from Zsh) is unavailable. Files in the pane interact with the command line; for example, Alt+Enter copies the name of a (selected) file to the command line.
Keybindings are generally similar to GNU Emacs. A more strict emacs keymap can be enabled (see Redefine hotkey bindings ). New users may however use Lynx-like (arrow) keybindings (enabled in F9 > Options > Panel options ) and mouse clicks for navigation.
Modules
These can be called via the mc interface (with Use internal enabled in F9 > Options > Configuration ), or separately as symbolic links to the mc binary.
- mcedit — Text and binary file editor, with regex replace, syntax highlighting, macros and shell piping, see mcedit(1)
- mcview — Text and hex viewer with goto marks and regex search
- mcdiff — Compares and edits two files in-place ( C-x d )
Per mc instance, multiple modules can be run concurrently ( Ctrl-` ) (see Screen selector ). External editors may be used instead, and parameters configured accordingly.
Configuration
Most of the Midnight Commander settings can be changed from the menus. However, a small number of settings such as clipboard commands, codeset detection and parameters for external editors can only be changed from
/.config/mc/ini . See Special Settings and following for a complete description of options.
Additionally, the following environment variables are respected: MC_SKIN , MC_KEYMAP , MC_XDG_OPEN , MC_COLOR_TABLE , MC_DATADIR , MC_HOME , KEYBOARD_KEY_TIMEOUT_US , PAGER , EDITOR , VIEWER .
extfs
extfs allows to easily create new virtual filesystems for mc. See /usr/lib/mc/extfs.d/README for details.
Советы и рекомендации
Переназначение сочетаний клавиш
Создайте копию стандартных комбинаций клавиш для текущего пользователя:
и отредактируйте файл под свои нужды. Вы можете использовать также другие файлы .keymap. Например, можно установить /etc/mc/mc.emacs.keymap при помощи переменной окружения MC_KEYMAP :
Смотрите также mc(1) для получения более подробной информации.
Навигация стрелками
Чтобы иметь возможность навигации по каталогам с помощью клавиш со стрелками как в Lynx, перейдите в меню Options ( F9 , o ) > Panel Options ( p ) и установите флажок Lynx-like motion в группе Navigation ( y ), затем нажмите OK ( o ).
Запуск из меню
Midnight Commander можно запускать из меню, создав файл desktop entry. Пример:
Поддержка корзины
Midnight Commander не поддерживает функцию корзины.
Использование libtrash
Библиотека libtrash перехватывает вызовы функций удаления файлов и вместо удаления выполняет перемещение файлов в корзину.
Установите libtrash AUR из AUR и создайте псевдоним для mc в файле инициализации вашей командной оболочки (например,
Чтобы изменения вступили в силу, переоткройте сеанс терминала или просто выполните скрипт инициализации командой source.
Стандартные настройки библиотеки находятся в файле /etc/libtrash.conf.sys . Вы можете переопределить их для текущего пользователя, создав пользовательский файл настроек
Теперь, после запуска mc, удаляемые файлы будут попадать в каталог корзины
Решение проблем
Выход в текущий каталог
При выходе, командная оболочка вернет вас с тот каталог, в котором вы запустили Midnight Commander. Если вы хотите, чтобы оставался текущий каталог, выбранный в Midnight Commander, простым решением будет просто скрывать интерфейс, не прерывая сеанс программы, нажатием Ctrl+O .
Искаженное изображение
Нажмите Ctrl+L для перерисовки интерфейса. Эта команда перерисует изображение, но не обновит список файлов в каталогах. Для обновления списка файлов на панелях используйте Ctrl+R .
Opening files
mc uses xdg-open to open files by default, as shown in /usr/lib/mc/ext.d/ . While stderr is redirected, stdout is not, which may result in a garbled screen.
Create a script to wrap xdg-open:
If mc is blocked until xdg-open ends, detach the process:
and make mc aware of it by setting the MC_XDG_OPEN environment variable:
Find file shows no results
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(2) ) instead, or the External panelize command.
Источник