mv.1 (1660B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2024-05-10
- .Dt MV 1
- .Os
- .Sh NAME
- .Nm mv
- .Nd move and rename files
- .Sh SYNOPSIS
- .Nm
- .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
- .Op Fl v
- .Ar source
- .Ar destfile
- .Nm
- .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
- .Op Fl v
- .Ar source...
- .Ar destdir
- .Nm
- .Op Fl f Ns | Ns Fl i Ns | Ns Fl n
- .Op Fl v
- .Fl t Ar destdir
- .Ar source...
- .Sh DESCRIPTION
- In the first form,
- .Nm
- moves each given
- .Ar source
- to
- .Ar destfile .
- This form is assumed when
- .Ar destfile
- does not refers to an existing directory, or a symlink pointing to one.
- Additionally, in this case a trailing slash and
- .Ar source
- not referring to a directory results in an error.
- .Pp
- In the second and third form,
- .Nm
- moves each given
- .Ar source
- into
- .Ar destdir
- with appending the
- .Ar source
- basename to
- .Ar destdir
- to create the full destination path.
- .Sh OPTIONS
- .Bl -tag -width _f
- .It Fl f
- Force, do not ask before overwriting to the destination path.
- Overrides previously set
- .Fl i
- and
- .Fl n
- options.
- .It Fl i
- Interactive, causes
- .Nm
- to ask before overwriting a file.
- Overrides previously set
- .Fl f
- and
- .Fl n
- options.
- .It Fl n
- No-clobber, never overwrite.
- Overrides previously set
- .Fl f
- and
- .Fl i
- options.
- .It Fl t Ar destdir
- Set the destination directory.
- .It Fl v
- Verbose, write which action has been done.
- .El
- .Sh EXIT STATUS
- .Ex -std
- .Sh STANDARDS
- .Nm
- should be compliant with the
- IEEE Std 1003.1-2024 (“POSIX.1”)
- specification.
- .Pp
- The
- .Fl n ,
- .Fl t Ar destdir
- and
- .Fl v
- options are extensions.
- .Sh HISTORY
- A
- .Nm
- command appeared in
- .At v1 .