
linux minicom
minicom
is a little command-line based tool used to connect serial-lines. In a more pragmatic definition, minicom can be used to connect modems, routers and switch console ports via the serial port. Minicom is very similar features and user interface to the TELIX.
minicom
是一个基于命令行的小工具,用于连接串行线。 用更实用的定义,minicom可用于通过串行端口连接调制解调器,路由器和交换机控制台端口。 Minicom与TELIX具有非常相似的功能和用户界面。
为Debian,Ubuntu,Kali,Mint安装 (Install For Debian, Ubuntu, Kali, Mint)
We can install minicom with the following command for deb based distributions.
对于基于deb的发行版,我们可以使用以下命令安装minicom。
$ sudo apt install minicom -y

为Fedora,CentOS,RHEL安装(Install For Fedora, CentOS, RHEL)
We can also install for rpm-based distributions like below.
我们也可以为基于rpm的发行版进行安装,如下所示。
$ sudo yum install minicom -y
列出tty设备 (List tty Devices)
We generally use minicom
with a physical port where it connects to a serial device like a switch, router, PBX, etc. Current PC configuration generally does not provides serial ports and prefer to use USB devices. We can use USB to serial converter. We can list existing serial lines or USB converted serial lines simply named tty
with the following command.
我们通常将minicom
与物理端口一起使用,该端口将物理端口连接到交换机,路由器,PBX等串行设备。当前的PC配置通常不提供串行端口,而更喜欢使用USB设备。 我们可以使用USB到串行转换器。 我们可以使用以下命令列出现有的串行线或USB转换的串行线,简称为tty
。
$ dmesg | grep tty

We also learn from the output that the TTY device base baud rate is 115200. Alternatively, the device can be named ttyUSB because modern TYY devices are created with USB hardware to connect computers.
我们还从输出中了解到,TTY设备的基本波特率为115200。该设备也可以命名为ttyUSB,因为现代的TYY设备是使用USB硬件创建的,用于连接计算机。
启动Minicom (Start Minicom)
We can start minicom without any option or parameter but providing a serial device is a better way. We will provide a USB-Serial converter which is located at /dev/ttyUSB0
. We should provide the sudo
command for root privileges.
我们可以在没有任何选项或参数的情况下启动minicom,但提供串行设备是更好的方法。 我们将提供一个USB-Serial转换器,位于/dev/ttyUSB0
。 我们应该为根特权提供sudo
命令。
$ sudo minicom /dev/ttyUSB0
退出Minicom (Exit Minicom)
After connecting minicom we may need to exit. But things work differently in minicom application. CTRL a
is used for special keys and other keys are used for different actions. We can exit like below.
连接minicom后,我们可能需要退出。 但是在minicom应用程序中,情况却有所不同。 CTRL a
用于特殊键,其他键用于不同的动作。 我们可以像下面那样退出。
CTRL a, x

帮助菜单 (Help Menu)
We can get help with the CTRL a, z
like below.
我们可以像下面的CTRL a, z
获得帮助。
CTRL a, z

We can see that generic help information about different actions like Clear Screen
,Configure Minicom
,Send Files
etc. listed in this help screen. All of the following options should be used with the CTRL+A
keyboard shortcut.
我们可以看到此帮助屏幕中列出了有关不同操作(如“ Clear Screen
,“ Configure Minicom
,“ Send Files
等)的一般帮助信息。 以下所有选项应与CTRL+A
键盘快捷键一起使用。
Dialing directory..D
run script (Go)….G
Clear Screen…….C
Send files………S
Receive files……R
cOnfigure Minicom..O
comm Parameters….P
Add linefeed…….A
Suspend minicom….J
Capture on/off…..L
Hangup………….H
eXit and reset…..X
send break………F
initialize Modem…M
Quit with no reset.Q
Terminal settings..T
run Kermit………K
Cursor key mode….I
lineWrap on/off….W
local Echo on/off..E
Help screen……..Z
Paste file………Y
Timestamp toggle…N
scroll Back……..B
Add Carriage Ret…U
列出当前的串行线参数(List Current Serial Line Parameters)
We can list current serial line communication parameters like below.
我们可以像下面列出当前的串行线路通信参数。
CTRL a, p

We can select the Speed
,Parity
, Stopbits
and Data
options from this menu by using letters. For example, to select speed 111200 we will press the E
key. We can change the parity to None
with L, Even
with M, Odd
with N, Mark
with O and Space
with P keys.
我们可以使用字母从此菜单中选择Speed
, Parity
, Stopbits
和Data
选项。 例如,要选择速度111200,我们将按E
键。 我们可以奇偶改为None
与L, Even
有男, Odd
与N, Mark
与O和Space
以P键。
更改串行线路参数(Change Serial Line Parameters)
We can change serial line parameters while starting the minicom. We need to provide the required options and values. Some of the most used options are as below.
我们可以在启动minicom时更改串行线路参数。 我们需要提供所需的选项和值。 一些最常用的选项如下。
$ sudo minicom -b 1200 -8 /dev/ttyUSB0
设定模式 (Setup Mode)
minicom provides an easy way to set up serial line parameters in command line GUI. We can provide the -s
option and enter.
minicom提供了一种在命令行GUI中设置串行线路参数的简便方法。 我们可以提供-s
选项并输入。

and enter the Serial port setup
menu like below.
然后进入如下所示的Serial port setup
菜单。

翻译自: https://www.poftut.com/install-use-linux-minicom-command-tutorial-examples/
linux minicom