mv Command Examples

Move or rename files and directories. More information: https://www.gnu.org/software/coreutils/mv.

mv {{path/to/source}} {{path/to/target}}

mv {{path/to/source}} {{path/to/existing_directory}}

mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}

mv --force {{path/to/source}} {{path/to/target}}

mv --interactive {{path/to/source}} {{path/to/target}}

mv --no-clobber {{path/to/source}} {{path/to/target}}

mv --verbose {{path/to/source}} {{path/to/target}}

{{find /var/log -type f -name '*.log' -print0}} | {{xargs -0}} mv --target-directory {{path/to/target_directory}}