move a file to a directory linux code example
Example 1: linux move file
# Linux - Bash
# syntax:
mv [options] <source-filepath> <destination-filepath>
# example-1 (fundamental - no switches):
mv "C:\Users\File_Name.txt" "C:\Users\SubFolder\File_Name.txt"
# example-2 (fundamental - with switches):
mv -u "C:\Users\File_Name.txt" "C:\Users\SubFolder\File_Name.txt"
# Switches
OPTION DESCRIPTION
mv -f force move by overwriting destination file without prompt
mv -i interactive prompt before overwrite
mv -u update - move when source is newer than destination
mv -v verbose - print source and destination files
Example 2: move directory with files linux
how to move a folder/Directory in Linux with files
#sytex
mv /path/to/source /path/to/destination
#example
mv Reports tools/Reports
Example 3: how to move file in directory in linux
mv file dir
Example 4: how to move file from one directory to another in linux
mv file1 /tmp
Example 5: linux command to move a file to another directory
mv filename directoryname