summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHeikki Korpela <heko@cvs.openbsd.org>2001-08-13 21:00:06 +0000
committerHeikki Korpela <heko@cvs.openbsd.org>2001-08-13 21:00:06 +0000
commit9c41801b72d10c481b58bf23758a0468295df595 (patch)
tree11bf03fdaa87c137d54b50619cbde2c796f37c93 /bin
parent03c9bddb9308a1b95d909bbee2140f4a0d15acf8 (diff)
Document how to remove or rename a file that is a getopt(3) flag
to mv(1) or rm(1) by preceding it with --. From ho@: Also give a sample of the ./-f way that is more portable ok millert@, ho@
Diffstat (limited to 'bin')
-rw-r--r--bin/mv/mv.113
-rw-r--r--bin/rm/rm.18
2 files changed, 19 insertions, 2 deletions
diff --git a/bin/mv/mv.1 b/bin/mv/mv.1
index 98fee2d56ef..70099cbe08f 100644
--- a/bin/mv/mv.1
+++ b/bin/mv/mv.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mv.1,v 1.12 2000/11/09 17:51:57 aaron Exp $
+.\" $OpenBSD: mv.1,v 1.13 2001/08/13 21:00:05 heko Exp $
.\" $NetBSD: mv.1,v 1.8 1995/03/21 09:06:51 cgd Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
@@ -134,6 +134,17 @@ to
overwriting
.Pa bar
if it already exists.
+.Pp
+.Cm mv -i -- -f bar ,
+.Cm mv -i ./-f bar
+.Pp
+Either of these commands will rename the file
+.Pa -f
+to
+.Pa bar ,
+prompting for confirmation if
+.Pa bar
+already exists.
.Sh SEE ALSO
.Xr cp 1 ,
.Xr symlink 7
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index cf282149a4b..2df0bbc8ed6 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rm.1,v 1.13 2001/06/08 13:41:21 millert Exp $
+.\" $OpenBSD: rm.1,v 1.14 2001/08/13 21:00:05 heko Exp $
.\" $NetBSD: rm.1,v 1.8 1995/07/25 19:37:30 jtc Exp $
.\"
.\" Copyright (c) 1990, 1993, 1994
@@ -138,6 +138,12 @@ exits with a value >0.
Recursively remove all files contained within the
.Pa foobar
directory hierarchy.
+.Pp
+.Cm rm -- -f ,
+.Cm rm ./-f
+.Pp
+Either of these commands will remove the file
+.Pa -f .
.Sh SEE ALSO
.Xr rmdir 1 ,
.\" .Xr undelete 2 ,