mv
for filesystem
Move files or directories using uutils/coreutils mv.
Signature
> mv {flags} ...rest
Flags
--force, -f
: do not prompt before overwriting--verbose, -v
: explain what is being done.--progress, -p
: display a progress bar--interactive, -i
: prompt before overwriting--update, -u
: move and overwrite only when the SOURCE file is newer than the destination file or when the destination file is missing--no-clobber, -n
: do not overwrite an existing file
Parameters
...rest
: Rename SRC to DST, or move SRC to DIR.
Input/output types:
input | output |
---|---|
nothing | nothing |
Examples
Rename a file
> mv before.txt after.txt
Move a file into a directory
> mv test.txt my/subdirectory
Move only if source file is newer than target file
> mv -u new/test.txt old/
Move many files into a directory
> mv *.txt my/subdirectory
Move a file into the "my" directory two levels up in the directory tree
> mv test.txt .../my/