mt - control magnetic tape drive operation
| Use Case | Command | Description |
|---|---|---|
| Rewind tape | mt rewind | Rewind the tape to the beginning. |
| Forward space files | mt fsf count | Skip forward count files, position on first block of next file. |
| Write EOF marks | mt eof count | Write count end-of-file marks at current position. |
| Print tape status | mt status | Display status information about the tape unit. |
mt [-V] [-f device] [--file=device] [--rsh-command=command] [--version] operation [count]
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 default tape device to operate on is taken from the file /usr/include/sys/mtio.h when mt is compiled. It can be overridden by giving a device file name in the environment variable TAPE or by a command line option (see below), which also overrides the environment variable.
๐พ 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:. 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).
๐ 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. Some operations optionally take a repeat count, which can be given after the operation name and defaults to 1.
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. โชfsfm โ Forward 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. ๐ขseek โ Seek to block number 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 โ Perform long erase of tape. If count is 0, perform short erase of tape (some devices do not support this). ๐งน๐ช 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.
-f, --file=device โ Use device as the file name of the tape drive to operate on. To use a tape drive on another machine, use a filename that starts with HOSTNAME:. 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). ๐--rsh-command=command โ Notifies mt that it should use command to communicate with remote devices instead of /usr/bin/ssh or /usr/bin/rsh. ๐-V, --version โ Print the version number of mt. โน๏ธReport bugs to bug-cpio AT gnu.org.
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/li- censes/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-27 13:08 @216.73.216.67
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)