命令行大全

mt

瑞兹 发表于 2021-02-06 09:04浏览次数:

在类似Unix的操作系统上,mt命令控制磁带设备。

查看英文版

目录:

1 mt 运行系统环境

2 mt 描述

3 mt 语法

mt 运行系统环境

Unix&Linux

mt 描述

默认的磁带设备进行操作,从文件中提取/usr/include/sys/mtio.hMT被编译。可以通过在环境变量 TAPE中指定设备文件名或使用命令行选项(请参见下文)来覆盖它,该选项也将覆盖环境变量。

该设备必须是字符专用文件或远程磁带驱动器。若要将另一台计算机上的磁带机用作存档,请使用以“ HOSTNAME: ”开头的文件名。主机名前面可以有一个用户名和一个@,以该用户的身份访问远程磁带驱动器(如果您具有这样做的权限)(通常是该用户的〜/ .rhosts文件中的一个条目)。

下面列出了可用的操作。接受唯一的缩写。并非所有操作在所有系统上均可用,或在所有类型的磁带机上均可用。某些操作可以选择重复计数,该计数可以在操作名称之后指定,默认为1

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 file name 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.

查看英文版

查看中文版

mt 语法

mt [-V] [-f device] [--file=device] [--rsh-command=command] [--version] operation [count]

运作方式

EOFWEOF 在当前位置写入计数EOF标记。
fsf 转发空间计数文件。磁带位于下一个文件的第一个块上。
bsf 向后空间计数文件。磁带位于下一个文件的第一个块上。
fsr 转发空间计数记录。
bsr 向后空间计数记录。
bsfm 向后空间计数文件标记。磁带位于文件标记的磁带开头侧。
fsfm 转发空间计数文件标记。磁带位于文件标记的磁带开头侧。
asf 文件号计数的绝对空间。等同于倒带,然后是fsf计数。
seek 寻求阻止号码计数。
eom 磁带上已记录媒体末尾的空间(用于将文件追加到磁带上)。
rewind 倒带。
offlinerewoffl 倒带,如果适用,请卸载带。
status 打印有关磁带机的状态信息。
retension 倒带,然后将其缠绕到卷轴的末端,然后再次倒带。
erase 擦除磁带。

选件

-f,--file =device 使用设备作为操作磁带机的文件名。要在另一台计算机上使用磁带驱动器,请使用以“ HOSTNAME: ”开头的文件名。该主机可以通过用户名和前面“ @ ”来访问远程磁带驱动器作为用户,如果你有这样的权限(通常在该用户的“的条目〜/ .rhosts中”文件)。
--rsh-command =command 通知mt应该使用命令而不是/ usr / bin / ssh/ usr / bin / rsh与远程设备通信。
-V,--version 打印mt的版本号。

退出状态

mt退出时的状态0,如果操作成功,1如果给定的操作或设备名称是无效的,或者2 ;如果操作失败。

mt [-V] [-f device] [--file=device] [--rsh-command=command] [--version] operation [count]

Operations

eofweof 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.
offlinerewoffl 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.

Options

-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 file name 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.

Exit Status

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.

查看英文版

查看中文版

发表评论
评论列表
共0条
点击加载更多