{
    "mode": "man",
    "parameter": "MT",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/MT/1/json",
    "generated": "2026-06-15T20:11:39Z",
    "synopsis": "mt [-V] [-f device] [--file=device] [--rsh-command=command] [--version] operation [count]",
    "sections": {
        "NAME": {
            "content": "mt - control magnetic tape drive operation\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mt [-V] [-f device] [--file=device] [--rsh-command=command] [--version] operation [count]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This  manual  page  documents  the GNU version of mt.  mt performs the given operation, which\nmust be one of the tape operations listed below, on a tape drive.\n\nThe default tape device to operate on is taken from the file /usr/include/sys/mtio.h when  mt\nis  compiled.   It can be overridden by giving a device file name in the environment variable\nTAPE or by a command line option (see below), which also overrides the environment variable.\n\nThe device must be either a character special file or a remote tape drive.   To  use  a  tape\ndrive  on  another  machine as the archive, use a filename that starts with `HOSTNAME:'.  The\nhostname can be preceded by a username and an `@' to access the remote  tape  drive  as  that\nuser, if you have permission to do so (typically an entry in that user's `~/.rhosts' file).\n\nThe available operations are listed below.  Unique abbreviations are accepted.  Not all oper‐\nations are available on all systems, or work on all types of tape  drives.   Some  operations\noptionally  take  a repeat count, which can be given after the operation name and defaults to\n1.\n\neof, weof\nWrite count EOF marks at current position.\n\nfsf    Forward space count files.  The tape is positioned on the  first  block  of  the  next\nfile.\n\nbsf    Backward  space  count  files.   The tape is positioned on the first block of the next\nfile.\n\nfsr    Forward space count records.\n\nbsr    Backward space count records.\n\nbsfm   Backward space count file marks.  The tape is positioned on the  beginning-of-the-tape\nside of the file mark.\n\nfsfm   Forward  space  count file marks.  The tape is positioned on the beginning-of-the-tape\nside of the file mark.\n\nasf    Absolute space to file number count.  Equivalent to rewind followed by fsf count.\n\nseek   Seek to block number count.\n\neom    Space to the end of the recorded media on the tape (for appending files onto tapes).\n\nrewind Rewind the tape.\n\noffline, rewoffl\nRewind the tape and, if applicable, unload the tape.\n\nstatus Print status information about the tape unit.\n",
            "subsections": [
                {
                    "name": "retension",
                    "content": "Rewind the tape, then wind it to the end of the reel, then rewind it again.\n\nerase  Perform long erase of tape. If count is 0, perform short erase of tape  (some  devices\ndo not support this).\n\nmt  exits  with  a  status of 0 if the operation succeeded, 1 if the operation or device name\ngiven was invalid, or 2 if the operation failed.\n\nOPTIONS"
                },
                {
                    "name": "-f --file=",
                    "content": "Use device as the file name of the tape drive to operate on.  To use a tape  drive  on\nanother  machine,  use  a  filename that starts with `HOSTNAME:'.  The hostname can be\npreceded by a username and an `@' to access the remote tape drive as that user, if you\nhave permission to do so (typically an entry in that user's `~/.rhosts' file).\n\n--rsh-command=command\nNotifies  mt  that it should use command to communicate with remote devices instead of\n/usr/bin/ssh or /usr/bin/rsh.\n",
                    "flag": "-f"
                },
                {
                    "name": "-V --version",
                    "content": "Print the version number of mt.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "BUG REPORTS": {
            "content": "Report bugs to <bug-cpio@gnu.org>.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2014 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n\n\n\n\nMT                                        January 28, 2014                                     MT(1)",
            "subsections": []
        }
    },
    "summary": "mt - control magnetic tape drive operation",
    "flags": [
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print the version number of mt."
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Control magnetic tape drive operation (commonly LTO tape).",
        "examples": [
            {
                "description": "Check the status of a tape drive",
                "command": "mt -f {{/dev/nstX}} status"
            },
            {
                "description": "Rewind the tape to beginning",
                "command": "mt -f {{/dev/nstX}} rewind"
            },
            {
                "description": "Move forward a given files, then position the tape on first block of next file",
                "command": "mt -f {{/dev/nstX}} fsf {{count}}"
            },
            {
                "description": "Rewind the tape, then position the tape at beginning of the given file",
                "command": "mt -f {{/dev/nstX}} asf {{count}}"
            },
            {
                "description": "Position the tape at the end of valid data",
                "command": "mt -f {{/dev/nstX}} eod"
            },
            {
                "description": "Rewind the tape and unload/eject it",
                "command": "mt -f {{/dev/nstX}} eject"
            },
            {
                "description": "Write EOF (End-of-file) mark at the current position",
                "command": "mt -f {{/dev/nstX}} eof"
            }
        ]
    }
}