aboutsummaryrefslogtreecommitdiff
path: root/bin/mv/mv.1
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-08-31 14:35:01 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-08-31 14:35:01 +0000
commit6ce6b6c1d414c603d1675e051e68371afe236ba5 (patch)
treea4d7515ca0e79ae9313694d57b632955e683f20c /bin/mv/mv.1
parent9e8100e77c547a8a077f8326af21ea20edb7c748 (diff)
downloadsrc-6ce6b6c1d414c603d1675e051e68371afe236ba5.tar.gz
src-6ce6b6c1d414c603d1675e051e68371afe236ba5.zip
Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Reviewed by: gj MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=239951
Diffstat (limited to 'bin/mv/mv.1')
-rw-r--r--bin/mv/mv.122
1 files changed, 19 insertions, 3 deletions
diff --git a/bin/mv/mv.1 b/bin/mv/mv.1
index 9e4d9ee0d4bd..5199f27bc068 100644
--- a/bin/mv/mv.1
+++ b/bin/mv/mv.1
@@ -32,7 +32,7 @@
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
-.Dd May 12, 2007
+.Dd August 28, 2012
.Dt MV 1
.Os
.Sh NAME
@@ -41,7 +41,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl f | i | n
-.Op Fl v
+.Op Fl hv
.Ar source target
.Nm
.Op Fl f | i | n
@@ -81,6 +81,21 @@ option overrides any previous
or
.Fl n
options.)
+.It Fl h
+If the
+.Ar target
+operand is a symbolic link to a directory,
+do not follow it.
+This causes the
+.Nm
+utility to rename the file
+.Ar source
+to the destination path
+.Ar target
+rather than moving
+.Ar source
+into the directory referenced by
+.Ar target .
.It Fl i
Cause
.Nm
@@ -142,7 +157,8 @@ rm -rf source_file
.Ex -std
.Sh COMPATIBILITY
The
-.Fl n
+.Fl h ,
+.Fl n ,
and
.Fl v
options are non-standard and their use in scripts is not recommended.