mv
for filesystem
Move files or directories.
Signature
> mv (source) (destination) --verbose --force --interactive --update
Parameters
source
: the location to move files/directories fromdestination
: the location to move files/directories to--verbose
(-v)
: make mv to be verbose, showing files been moved.--force
(-f)
: overwrite the destination.--interactive
(-i)
: ask user to confirm action--update
(-u)
: move only when the SOURCE file is newer than the destination file(with -f) or when the destination file is missing
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 many files into a directory
> mv *.txt my/subdirectory