make source match the man page, handle -number/+number more cleanly
[unix-history] / usr / src / usr.bin / mt / mt.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1981, 1990 The Regents of the University of California.
f56e8d15 2.\" All rights reserved.
7345243f 3.\"
7345243f 4.\"
555f1dc6
CL
5.\" %sccs.include.redist.roff%
6.\"
7.\" @(#)mt.1 6.7 (Berkeley) %G%
f56e8d15 8.\"
b5dc1377 9.Dd
b5dc1377
CL
10.Dt MT 1
11.Os BSD 4
12.Sh NAME
13.Nm mt
14.Nd magnetic tape manipulating program
15.Sh SYNOPSIS
16.Nm mt
17.Op Fl f Ar tapename
18.Ar command
19.Op Ar count
20.Sh DESCRIPTION
21.Nm Mt
967568a6 22is used to give commands to a magnetic tape drive.
967568a6 23By default
b5dc1377 24.Nm mt
967568a6
KM
25performs the requested operation once. Operations
26may be performed multiple times by specifying
b5dc1377 27.Ar count .
555f1dc6
CL
28Note
29that
30.Ar tapename
31must reference a raw (not block) tape device.
b5dc1377 32.Pp
967568a6
KM
33The available commands are listed below. Only as many
34characters as are required to uniquely identify a command
35need be specified.
555f1dc6
CL
36.Bl -tag -width "eof, weof"
37.It Cm eof , weof
b5dc1377
CL
38Write
39.Ar count
967568a6 40end-of-file marks at the current position on the tape.
555f1dc6 41.It Cm fsf
967568a6 42Forward space
b5dc1377 43.Ar count
967568a6 44files.
555f1dc6 45.It Cm fsr
b5dc1377
CL
46Forward space
47.Ar count
967568a6 48records.
555f1dc6 49.It Cm bsf
b5dc1377
CL
50Back space
51.Ar count
967568a6 52files.
555f1dc6 53.It Cm bsr
967568a6 54Back space
b5dc1377 55.Ar count
967568a6 56records.
555f1dc6 57.It Cm rewind
967568a6 58Rewind the tape
b5dc1377 59(Count is ignored).
555f1dc6 60.It Cm offline , rewoffl
967568a6 61Rewind the tape and place the tape unit off-line
b5dc1377 62(Count is ignored).
555f1dc6 63.It Cm status
967568a6 64Print status information about the tape unit.
555f1dc6
CL
65.El
66.Pp
67If a tape name is not specified, and the environment variable
68.Ev TAPE
69does not exist;
70.Nm mt
71uses the device
72.Pa /dev/rmt12 .
b5dc1377
CL
73.Pp
74.Nm Mt
967568a6
KM
75returns a 0 exit status when the operation(s) were successful,
761 if the command was unrecognized, and 2 if an operation failed.
b5dc1377 77.Sh ENVIRONMENT
5325ced3
CL
78If the following environment variable exists, it is utilized by
79.Nm mt .
555f1dc6
CL
80.Bl -tag -width Fl
81.It Ev TAPE
b5dc1377
CL
82.Nm Mt
83checks the
84.Ev TAPE
85environment variable if the
86argument
5325ced3
CL
87.Ar tapename
88is not given.
b5dc1377 89.Sh FILES
555f1dc6
CL
90.Bl -tag -width /dev/rmt* -compact
91.It Pa /dev/rmt*
b5dc1377 92Raw magnetic tape interface
555f1dc6 93.El
b5dc1377
CL
94.Sh SEE ALSO
95.\".Xr mtio 4 ,
96.Xr dd 1 ,
97.Xr ioctl 2 ,
98.Xr environ 7
99.Sh HISTORY
555f1dc6
CL
100The
101.Nm mt
102command appeared in
103.Bx 4.3 .
b5dc1377 104.\" mt.1: mtio(4) missing