命令行大全

cu

rose1 发表于 2020-08-27 15:08浏览次数:

在类似Unix的操作系统上,cu命令“调用”(连接到)另一个Unix 系统。

查看英文版

目录:

1 cu 运行系统环境

2 cu 说明

3 cu 语法

4 cu 例子

cu 运行系统环境

Linux

cu 说明

cu命令用于调用另一个系统并作为拨号终端。它还可以进行简单的文件传输,而不会进行错误检查。

cu除选项外还接受一个参数。如果参数是字符串“ dir”,则cu将直接连接到port。只有对端口具有写访问权的用户才能使用此功能,因为它允许对调制解调器进行重新编程。

否则,如果参数以digit开头,则将其视为要拨打的电话号码。否则,将其作为要调用的系统的名称。该-z或--system选项可以用来名称以数字开头的系统和-c或--phone选项可以被用来命名不以数字开头的电话号码。

cu定位要在UUCP(Unix到Unix副本)配置文件中使用的端口。如果给出一个简单的系统名称,它将选择适合该系统的端口。的-p,--port,-l,--line,-s--speed选项可以被用于控制端口选择。

当建立连接时到远程系统,铜 叉成两个处理。一个从端口读取并写入终端,而另一个从终端读取并写入端口。

cu提供了在对话过程中可能会使用的几个命令。所有命令均以转义 字符开头,最初为〜(波浪号)。转义字符仅在行的开头识别。要在一行的开头向远程系统发送一个转义字符,必须输入两次。所有命令都是单个字符或以%(百分号)开头的单词。

The cu command is used to call up another system and act as a dial-in terminal. It can also do simple file transfers with no error checking.

cu takes a single argument, besides the options. If the argument is the string "dir" cu will make a direct connection to the port. This may only be used by users with write access to the port, as it permits reprogramming the modem.

Otherwise, if the argument begins with a digit, it is taken to be a phone number to call. Otherwise, it is taken to be the name of a system to call. The -z or --system option may be used to name a system beginning with a digit, and the -c or --phone option may be used to name a phone number that does not begin with a digit.

cu locates a port to use in the UUCP (Unix-to-Unix copy) configuration files. If a simple system name is given, it will select a port appropriate for that system. The -p--port-l--line-s and --speed options may be used to control the port selection.

When a connection is made to the remote system, cu forks into two processes. One reads from the port and writes to the terminal, while the other reads from the terminal and writes to the port.

cu provides several commands that may be used during the conversation. The commands all begin with an escape character, initially ~ (tilde). The escape character is only recognized at the beginning of a line. To send an escape character to the remote system at the start of a line, it must be entered twice. All commands are either a single character or a word beginning with % (percent sign).

查看英文版

查看中文版

cu 语法

cu [ options ] [ system | phone | "dir"

指令

cu可以识别以下命令:

~. 终止对话。
~!command 在shell中运行命令。如果命令为空,则启动外壳程序。 
~$command 运行命令,将标准输出发送到远程系统。
~|command 运行command,从远程系统获取标准输入。 
~+command 运行command,从远程系统获取标准输入,然后将标准输出发送到远程系统。
~#~%break 如果可能,发送中断信号。
~cdirectory, ~%cddirectory 更改本地目录。
~> file 将文件发送到远程系统。这只是通过通信线路转储文件。假定远程系统正在期望它。
~< 从远程系统接收文件。这将提示您输入本地文件名,并提示您执行远程命令以开始文件传输。它继续接受数据,直到看到eofread变量的内容为止。
~p from to, ~%putfrom to 将文件发送到远程Unix系统。这将在远程系统上运行适当的命令。
~t from to, ~%takefrom to 从远程Unix系统中检索文件。这将在远程系统上运行适当的命令。
~s variablevalue cu 变量设置为给定值。如果未提供值,则将变量设置为true
~! variable cu 变量设置为false
~z 暂停cu会话。仅某些系统支持此功能。在可能使用^ Z挂起作业的系统上,〜^ Z也会挂起会话。
~%nostop 关闭XON / XOFF处理。
~%stop 打开XON / XOFF处理。
~v 列出所有变量及其值。
~? 列出所有命令。

变数

cu还支持多个变量。它们可能用〜v命令列出,并用〜s〜!设置。命令。

escape 转义字符。最初(波浪号)。
delay 如果此变量为true,则cu将在识别出转义字符后延迟一秒钟,然后再打印本地系统的名称。默认值为true
eol 视为结束一行的字符列表。仅当看到其中一个后,才能识别转义字符。缺省值是回车(CR),为^ U,^ C,= O,^ d,2 -S,^ Q,^ R。
binary 发送文件时是否传输二进制数据。如果为假,则将发送文件中的换行符转换为回车符。默认值为false
binary-prefix 如果二进制变量为true,则在文件传输中发送二进制字符之前使用的字符串。默认值是^ V
echo-check 不管是通过什么检查远程系统检查文件传输回声回。默认值为false
echonl 发送文件中的每一行后要查找的字符。默认值为回车。
timeout 查找字符,执行回显检查或查找echonl字符时使用的超时(以秒为单位)。默认值为30
kill 如果回显检查失败,则用于删除行的字符。默认值是为^ U
resend 如果回显检查继续失败,则重新发送行的次数。默认值为10
eofwrite 使用〜>命令发送文件后要写入的字符串。默认值是^ d
eofread 使用〜<命令接收文件时要查找的字符串。默认值为$,它是典型的shell 提示。
verbose 在文件传输期间是否打印累积的信息。默认值为true

选件

-e, --parity=even 使用偶校验。
-o, --parity=odd 使用奇偶校验。
--parity=none 不使用奇偶校验。如果同时给出了-e-o,则不使用奇偶校验。
-h, --halfduplex 本地回显字符(半双工模式)。
--nostop 关闭XON / XOFF处理(默认情况下处于启用状态)。
-E char, --escape char 设置转义字符。最初〜(波浪号)。要消除转义符,请使用-E''。
-z system, --systemsystem 系统调用。
-c phone-number, --phone phone-number 要拨打的电话号码。
-p port, --port port 命名要使用的端口。
-a port 等效于--port port。
-l line, --line line 通过提供设备名称来命名要使用的行。这可以用于拨出未在UUCP配置文件中列出的端口。需要对该设备进行写访问。
-s speed, --speedspeed 使用的速度(波特率)。
-# 其中#是数字,等效于--speed #。
-n, --prompt 提示您使用的电话号码。
-d 进入调试模式。等效于--debug all
-x type, --debug type 打开特定的调试类型。可以识别以下类型:异常,聊天,握手,uucp-proto,proto,port,config,spooldir,execute,incoming,outgoing。只有异常,聊天,握手,端口,配置,传入和传出对于cu才有意义。

可以给出多种类型,用逗号分隔,以及--debug选项可能会出现多次。也可以给出一个数字,它将打开前面列表中的许多类型。例如,--debug 2相当于--debug 异常,聊天。--debug all可用于打开所有调试选项。
-I file, --config file 设置要使用的配置文件。根据cu的编译方式,此选项可能不可用。
-v, --version 报告版本信息并退出。
--help 打印帮助消息并退出。
cu [ options ] [ system | phone | "dir"

Commands

cu recognizes the following commands:

~. Terminate the conversation.
~!command Run command in a shell. If command is empty, starts up a shell.
~$command Run command, sending the standard output to the remote system.
~|command Run command, taking the standard input from the remote system.
~+command Run command, taking the standard input from the remote system and sending the standard output to the remote system.
~#~%break Send a break signal, if possible.
~cdirectory, ~%cddirectory Change the local directory.
~> file Send a file to the remote system. This just dumps the file over the communication line. It is assumed that the remote system is expecting it.
~< Receive a file from the remote system. This prompts for the local file name and for the remote command to execute to begin the file transfer. It continues accepting data until the contents of the eofread variable are seen.
~p from to, ~%putfrom to Send a file to a remote Unix system. This runs the appropriate commands on the remote system.
~t from to, ~%takefrom to Retrieve a file from a remote Unix system. This runs the appropriate commands on the remote system.
~s variablevalue Set a cu variable to the given value. If value is not given, the variable is set to true.
~! variable Set a cu variable to false.
~z Suspend the cu session. This is only supported on some systems. On systems for which ^Z may be used to suspend a job, ~^Z will also suspend the session.
~%nostop Turn off XON/XOFF handling.
~%stop Turn on XON/XOFF handling.
~v List all the variables and their values.
~? List all commands.

Variables

cu also supports several variables. They may be listed with the ~v command, and set with the ~s or ~! commands.

escape The escape character. Initially ~ (tilde).
delay If this variable is truecu will delay for a second after recognizing the escape character before printing the name of the local system. The default is true.
eol The list of characters that are considered to finish a line. The escape character is only recognized after one of these is seen. The default is carriage return (CR), ^U^C^O^D^S^Q^R.
binary Whether to transfer binary data when sending a file. If this is false, then newlines in the file being sent are converted to carriage returns. The default is false.
binary-prefix A string used before sending a binary character in a file transfer, if the binary variable is true. The default is ^V.
echo-check Whether to check file transfers by examining what the remote system echoes back. The default is false.
echonl The character to look for after sending each line in a file. The default is carriage return.
timeout The timeout to use, in seconds, when looking for a character, either when doing echo checking or when looking for the echonl character. The default is 30.
kill The character to use to delete a line if the echo check fails. The default is ^U.
resend The number of times to resend a line if the echo check continues to fail. The default is 10.
eofwrite The string to write after sending a file with the ~> command. The default is ^D.
eofread The string to look for when receiving a file with the ~< command. The default is $, which is intended to be a typical shell prompt.
verbose Whether to print accumulated information during a file transfer. The default is true.

Options

-e--parity=even Use even parity.
-o--parity=odd Use odd parity.
--parity=none Use no parity. No parity is also used if both -e and -o are given.
-h--halfduplex Echo characters locally (half-duplex mode).
--nostop Turn off XON/XOFF handling (it is on by default).
-E char, --escape char Set the escape character. Initially ~ (tilde). To eliminate the escape character, use -E ''.
-z system, --systemsystem The system to call.
-c phone-number, --phone phone-number The phone number to call.
-p port, --port port Name the port to use.
-a port Equivalent to --port port.
-l line, --line line Name the line to use by giving a device name. This may be used to dial out on ports that are not listed in the UUCP configuration files. Write access to the device is required.
-s speed, --speedspeed The speed (baud rate) to use.
-# Where # is a number, equivalent to --speed #.
-n--prompt Prompt for the phone number to use.
-d Enter debugging mode. Equivalent to --debug all.
-x type, --debug type Turn on particular debugging types. The following types are recognized: abnormalchathandshakeuucp-protoprotoportconfigspooldirexecuteincomingoutgoing. Only abnormalchathandshakeportconfigincoming and outgoing are meaningful for cu.

Multiple types may be given, separated by commas, and the --debug option may appear multiple times. A number may also be given, which will turn on that many types from the foregoing list; for example, --debug 2 is equivalent to --debug abnormalchat--debug all may be used to turn on all debugging options.
-I file, --config file Set configuration file to use. This option may not be available, depending upon how cu was compiled.
-v--version Report version information and exit.
--help Print a help message and exit.

查看英文版

查看中文版

cu 例子

cu -s 38400 9=12015551234

在拨打的电话号码的系统是(201)555 - 1235。此示例还使用9离开建筑物,以及使用1拨打长途电话。

cu -s 38400 9=12015551234

Dials a system at the phone number is (201555-1235. This example is also using a 9 to get out of the building as well as a 1 to dial long distance.

查看英文版

查看中文版