GMT(1L)

NAME
mt - control magnetic tape drive operation

SYNOPSIS
mt [-f device] [+file device] operation [count]

DESCRIPTION
This manual page documents the GNU version of mt. mt performs the given operation, which must be one of the tape operations listed below, on a tape drive. The path of the tape device to operate on can be given with the -f or +file option. If neither of those options is given, and the environment variable TAPE is set, it is used. Otherwise, a default device defined in the file /usr/include/sys/mtio.h is used. The device must be either a character special file or a remote tape drive. To use a tape drive on another machine as the archive, use a filename that starts with `HOSTNAME:/dev/'. The hostname can be preceded by a username and an `@' to access the remote tape drive as that user, if you have permission to do so (typically an entry in that user's `~/.rhosts' file).

Some operations optionally take a repeat count, which can be given after the operation name and defaults to 1.

The available operations are listed below. Unique abbreviations are accepted. Not all operations are available on all systems, or work on all types of tape drives.

eof, weof
    Write count EOF marks at current position.

fsf Forward space count files. The tape is positioned on the first block of the next file.

bsf Backward space count files. The tape is positioned on the first block of the next file.

fsr Forward space count records.

bsr Backward space count records.

bsfm
    Backward space count file marks. The tape is positioned on the beginning-of-the-tape side of the file mark.

asf Absolute space to file number count. Equivalent to rewind followed by fsf count.

eom Space to the end of the recorded media on the tape (for appending files onto tapes).

rewind
    Rewind the tape.

offline, rewoffl
    Rewind the tape and, if applicable, unload the tape.

status
    Print status information about the tape unit.

retension
    Rewind the tape, then wind it to the end of the reel, then rewind it again.

erase
    Erase the tape.

mt exits with a status of 0 if the operation succeeded, 1 if the operation or device name given was invalid, or 2 if the operation failed.