CentOS/RHEL 6:安装Midnight Commander文件管理器

时间:2020-01-09 10:34:16  来源:igfitidea点击:

如何使用bash命令行在Red Hat Enterprise Linux或CentOS Linux服务器版本5.x/6.x上安装GNU mc(Midnight Commander)?

GNU Midnight Commander(也称为mc)是一个免费的可视文件管理器,已获得GNU通用公共许可证的许可。
它是Norton Commander的克隆。
它由Miguel de Icaza于1994年启动。
它具有功能丰富的全屏文本模式应用程序,可让您复制,移动和删除文件以及整个目录树,搜索文件并在子Shell中运行命令。
包括内部查看器和编辑器。

在Centos/RHEL/Fedora Linux上安装Midnight Commander(mc)

打开终端或使用ssh客户端登录到远程服务器。
键入以下yum命令来安装mc:

# yum install mc

输出示例:

Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mc.x86_64 1:4.7.0.2-3.el6 will be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
Package  Arch         Version                Repository                   Size
================================================================================
Removing:
mc       x86_64       1:4.7.0.2-3.el6        @rhel-x86_64-server-6       5.4 M
 
Transaction Summary
================================================================================
Remove        1 Package(s)
 
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : 1:mc-4.7.0.2-3.el6.x86_64                                    1/1 
  Verifying  : 1:mc-4.7.0.2-3.el6.x86_64                                    1/1 
 
Removed:
  mc.x86_64 1:4.7.0.2-3.el6                                                     
 
Complete!
{[email protected] }# 
{[email protected] }# yum install mc
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mc.x86_64 1:4.7.0.2-3.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
Package  Arch         Version                 Repository                  Size
================================================================================
Installing:
mc       x86_64       1:4.7.0.2-3.el6         rhel-x86_64-server-6       1.6 M
 
Transaction Summary
================================================================================
Install       1 Package(s)
 
Total download size: 1.6 M
Installed size: 0  
Is this ok [y/N]: y
Downloading Packages:
mc-4.7.0.2-3.el6.x86_64.rpm                              | 1.6 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:mc-4.7.0.2-3.el6.x86_64                                    1/1 
  Verifying  : 1:mc-4.7.0.2-3.el6.x86_64                                    1/1 
 
Installed:
  mc.x86_64 1:4.7.0.2-3.el6                                                     
 
Complete!

如何使用mc?

只需键入以下命令:

$ mc

如您所见,"Midnight Commander"的屏幕分为四个部分。
几乎所有屏幕空间都由两个目录面板占用。
默认情况下,屏幕底部的第二行是shell命令行,而底行显示功能键标签。
最上面的一行是菜单栏行。
菜单栏行可能不可见,但是如果您用鼠标单击最上面的行或按" F9"键,则会出现。

mc语法和命令示例

以下是一些有用的示例和语法:

强制黑白显示

$ mc -b

mc的强制颜色模式

$ mc -c

对MC禁用鼠标支持

$ mc -d

用内部编辑器启动mc

$ mc -e
$ mc -e /path/to/file.txt