xref: /original-bsd/usr.bin/mt/mt.1 (revision f3c03cba)
1.\" Copyright (c) 1981, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)mt.1	6.5 (Berkeley) 07/24/90
7.\"
8.Dd
9.Os BSD 4.4
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
22is used to give commands to a magnetic tape drive.
23If a tape name is not specified, the environment variable
24.Ev TAPE
25is used;  if
26.Ev TAPE
27does not exist,
28.Nm mt
29uses the device
30.Pa /dev/rmt12 .
31Note
32that
33.Ar tapename
34must reference a raw (not block) tape device.
35By default
36.Nm mt
37performs the requested operation once.  Operations
38may be performed multiple times by specifying
39.Ar count  .
40.Pp
41The available commands are listed below.  Only as many
42characters as are required to uniquely identify a command
43need be specified.
44.Tp Cm eof , weof
45Write
46.Ar count
47end-of-file marks at the current position on the tape.
48.Tp Cm fsf
49Forward space
50.Ar count
51files.
52.Tp Cm fsr
53Forward space
54.Ar count
55records.
56.Tp Cm bsf
57Back space
58.Ar count
59files.
60.Tp Cm bsr
61Back space
62.Ar count
63records.
64.Tp Cm rewind
65Rewind the tape
66(Count is ignored).
67.Tp Cm offline , rewoffl
68Rewind the tape and place the tape unit off-line
69(Count is ignored).
70.Tp Cm status
71Print status information about the tape unit.
72.Tp
73.Pp
74.Nm Mt
75returns a 0 exit status when the operation(s) were successful,
761 if the command was unrecognized, and 2 if an operation failed.
77.Sh ENVIRONMENT
78If the following environment variable exists, it is utilized by
79.Nm mt .
80.Tw Fl
81.Tp Ev TAPE
82.Nm Mt
83checks the
84.Ev TAPE
85environment variable if the
86argument
87.Ar tapename
88is not given.
89.Sh FILES
90.Dw /dev/rmt*
91.Di L
92.Dp Pa /dev/rmt*
93Raw magnetic tape interface
94.Dp
95.Sh SEE ALSO
96.\".Xr mtio 4 ,
97.Xr dd 1 ,
98.Xr ioctl 2 ,
99.Xr environ 7
100.Sh HISTORY
101.Nm Mt
102appeared in 4.3 BSD.
103.\" mt.1: mtio(4) missing
104