xref: /netbsd-src/bin/mt/mt.1 (revision ae9172d6cd9432a6a1a56760d86b32c57a66c39c)
1.\" Copyright (c) 1981, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. All advertising materials mentioning features or use of this software
14.\"    must display the following acknowledgement:
15.\"	This product includes software developed by the University of
16.\"	California, Berkeley and its contributors.
17.\" 4. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"	from: @(#)mt.1	6.7 (Berkeley) 7/28/91
34.\"	$Id: mt.1,v 1.3 1994/10/16 11:46:49 andrew Exp $
35.\"
36.Dd July 28, 1991
37.Dt MT 1
38.Os BSD 4
39.Sh NAME
40.Nm mt
41.Nd magnetic tape manipulating program
42.Sh SYNOPSIS
43.Nm mt
44.Op Fl f Ar tapename
45.Ar command
46.Op Ar count
47.Sh DESCRIPTION
48.Nm Mt
49is used to give commands to a magnetic tape drive.
50By default
51.Nm mt
52performs the requested operation once.  Operations
53may be performed multiple times by specifying
54.Ar count  .
55Note
56that
57.Ar tapename
58must reference a raw (not block) tape device.
59.Pp
60The available commands are listed below.  Only as many
61characters as are required to uniquely identify a command
62need be specified.
63.Bl -tag -width "eof, weof"
64.It Cm eof , weof
65Write
66.Ar count
67end-of-file marks at the current position on the tape.
68.It Cm fsf
69Forward space
70.Ar count
71files.
72.It Cm fsr
73Forward space
74.Ar count
75records.
76.It Cm bsf
77Back space
78.Ar count
79files.
80.It Cm bsr
81Back space
82.Ar count
83records.
84.It Cm rewind
85Rewind the tape
86(Count is ignored).
87.It Cm offline , rewoffl
88Rewind the tape and place the tape unit off-line
89(Count is ignored).
90.It Cm status
91Print status information about the tape unit.
92.It Cm retension
93Retensions the tape (if this operation is supported by the tape unit).
94.It Cm erase
95Erases the tape (if this operation is supported by the tape unit).
96.It Cm eom
97Forward space to the end of the media.
98.El
99.Pp
100If a tape name is not specified, and the environment variable
101.Ev TAPE
102does not exist;
103.Nm mt
104uses the device
105.Pa /dev/rmt12 .
106.Pp
107.Nm Mt
108returns a 0 exit status when the operation(s) were successful,
1091 if the command was unrecognized, and 2 if an operation failed.
110.Sh ENVIRONMENT
111If the following environment variable exists, it is utilized by
112.Nm mt .
113.Bl -tag -width Fl
114.It Ev TAPE
115.Nm Mt
116checks the
117.Ev TAPE
118environment variable if the
119argument
120.Ar tapename
121is not given.
122.Sh FILES
123.Bl -tag -width /dev/rmt* -compact
124.It Pa /dev/rmt*
125Raw magnetic tape interface
126.El
127.Sh SEE ALSO
128.\".Xr mtio 4 ,
129.Xr dd 1 ,
130.Xr ioctl 2 ,
131.Xr environ 7
132.Sh HISTORY
133The
134.Nm mt
135command appeared in
136.Bx 4.3 .
137.\" mt.1: mtio(4) missing
138