cu —
serial
terminal emulator
cu |
[-dr]
[-l
line]
[-s
speed |
-speed] |
cu is used to connect to another system over a
serial link. In the era before modern networks, it was typically used to
connect to a modem in order to dial in to a remote host. It is now frequently
used for tasks such as attaching to the serial console of another machine for
administrative or debugging purposes.
The options are as follows:
-
-
- -d
- Specify that the line is directly connected and
cu should not allow the driver to block
waiting for a carrier to be detected.
-
-
- -l
line
- Specify the line to use. Either of the forms like
cua00 or
/dev/cua00 are permitted. The default is
/dev/cua00. See
cua(4) for information on
terminal devices. Users in group “dialer” are permitted to
use cua(4) devices by
default.
-
-
- -r
- Start cu in restricted mode.
This prevents all local filesystem operations and command executions.
-
-
- -s
speed |
-speed
- Set the speed of the connection. The default is 9600.
If
host is given,
cu uses the
remote(5) database to retrieve
the
dc (directly connected),
dv (device) and
br
(baud rate) capabilities for that host. The
cu
utility ignores other capabilities found in that database.
Typed characters are normally transmitted directly to the remote machine (which
does the echoing as well). A tilde (‘
~
’)
appearing as the first character of a line is an escape signal; the following
are recognized:
-
-
- ~^D
or ~.
- Drop the connection and exit. Only the connection is
dropped – the login session is not terminated.
-
-
- ~>
- Copy file from local to remote.
cu prompts for the name of a local file to
transmit.
-
-
- ~$
- Pipe the output from a local UNIX
process to the remote host. The command string sent to the local
UNIX system is processed by the shell. This
command is not allowed in restricted mode.
-
-
- ~#
- Send a
BREAK
to the
remote system.
-
-
- ~^Z
- Stop cu (only available with
job control).
-
-
- ~C
- Fork a child process on the local system to perform special
protocols such as XMODEM. The child program will be run with the following
arrangement of file descriptors:
0 <-> remote tty in
1 <-> remote tty out
2 <-> local tty stderr
This command is not allowed in restricted mode.
-
-
- ~D
- Deassert the data terminal ready (DTR) line briefly. This
command is not allowed in restricted mode.
-
-
- ~R
- Record all output from the remote system to a file. If the
given file already exists, it is appended to. If no file is specified, any
existing recording is stopped. This command is not allowed in restricted
mode.
-
-
- ~S
- Change the speed of the connection.
-
-
- ~X
- Send a file with the XMODEM protocol. This command is not
allowed in restricted mode.
-
-
- ~?
- Get a summary of the tilde escapes.
When
cu prompts for an argument, for example during
setup of a file transfer, the line typed may be edited with the standard erase
and kill characters. A null line in response to a prompt, or an interrupt,
will abort the dialogue and return the user to the remote machine.
cu guards against multiple users connecting to a
remote system by opening modems and terminal lines with exclusive access.
-
-
HOST
- The default value for host
if none is specified via the command line.
-
-
REMOTE
- A system description, or an absolute path to a
remote(5) system description
database.
-
-
- /etc/remote
- host description file
The
cu utility exits 0 on success,
and >0 if an error occurs.
remote(5)
The
cu command appeared in
4.2BSD. This version was written for
OpenBSD 5.4 by Nicholas Marriott.