aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man1/mv.1
blob: 45453f24ed1709d10301d547e5bbd003c302e478 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.\"	%NetBSD: mv.1,v 1.8 1995/03/21 09:06:51 cgd Exp %
.\"
.\" Copyright (c) 1989, 1990, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"	@(#)mv.1	8.1 (Berkeley) 5/31/93
.\" %FreeBSD: src/bin/mv/mv.1,v 1.15.2.3 2001/08/16 10:01:06 ru Exp %
.\"
.\" $FreeBSD: doc/ja_JP.eucJP/man/man1/mv.1,v 1.11 2001/07/29 05:14:51 horikawa Exp $
.Dd May 31, 1993
.Dt MV 1
.Os
.Sh 名称
.Nm mv
.Nd ファイルの移動
.Sh 書式
.Nm
.Op Fl f | Fl i
.Op Fl v
.Ar source target
.Nm
.Op Fl f | Fl i
.Op Fl v
.Ar source ... directory
.Sh 解説
1 番目の書式の場合、
.Nm
ユーティリティは
.Ar source
オペランドで指定される名前のファイルの名前を、
.Ar target
オペランドで指定される名前のデスティネーションパスに変更します。
最後に指定されるオペランドが既に存在するディレクトリの名前ではない場合に
この書式であるとされます。
.Pp
2 番目の書式の場合、各々の
.Ar source
オペランドで指定される名前のファイルを、
.Ar directory
オペランドで指定される名前で既に存在するディレクトリの中の
デスティネーションファイルに移動します。
各々のオペランドに対応するデスティネーションパスは、
``最後のオペランド''と``スラッシュ''と``ファイルのパス名の最後の部分''
の結合によって生成されるパス名です。
.Pp
オプションとしては以下のものがあります:
.Bl -tag -width flag
.It Fl f
デスティネーションパスを上書きする前に、
書き込みパーミッションがあるなしにかかわらず、確認せず実行します。
(
.Fl f
オプションが指定されると、それ以前の
.Fl i
オプションは無視されます。)
.It Fl i
すでに移動先に同名のファイルが存在する場合、実行してよいかどうか確認を
標準エラー出力を使用して
求めます。標準入力から
.Sq Li y
または
.Sq Li Y
で始まる文字列が入力されると、実行されます。
(
.Fl i
オプションが指定されると、それ以前の
.Fl f
オプションは無視されます。)
.It Fl v
.Nm
を冗長にし、移動後にファイルを表示させます。
.El
.Pp
.Ar source
オペランドとデスティネーションパスがともにディレクトリである場合を除き、
オペランドもしくはデスティネーションパスに
ディレクトリを指定することは誤りです。
.Pp
デスティネーションパスが書き込み許可をしていない場合、
.Nm
は、
.Fl i
オプションと同じように、
ユーザの確認を求めます。
.Pp
.Nm
は、通常、システムコール
.Xr rename 2
を使ってファイルの移動をします。しかし、
.Xr rename 2
は、ファイルシステムを越えてファイルを移動することがで
きません。このため、
.Ar source
と
.Ar target
が違うファイルシステム上の場合、
.Nm
は、
.Xr cp 1
と
.Xr rm 1
を使って移動を行います。これは、次の結果と等価です。
.Bd -literal -offset indent
rm -f destination_path && \e
\tcp -pRP source_file destination && \e
\trm -rf source_file
.Ed
.Sh 診断
.Nm
ユーティリティは、成功時には 0 を、エラー時には 0 より大きな値を返し、
終了します。
.Sh 関連項目
.Xr cp 1 ,
.Xr rm 1 ,
.Xr symlink 7
.Sh 互換性
.Fl v
は標準ではありませんし、スクリプト中での使用はお勧めしません。
.Sh 規格
.Nm
ユーティリティは
.St -p1003.2
互換です。
.Sh 歴史
.Nm
コマンドは
.At v1
から登場しました。