target_file can be a file name, a directory (in this case the file will be moved to another directory), or a directory/file name (in this case the file will be moved to another directory and renamed).
Moving a directory, will move the directory and all its contents.
When moving files and directories, the inode number and timestamp of these files and directories are not changed.
Examples
Moving file:
Move file1 from folder1 to folder2 (see bellow the options -i and -n to check if the destination file already exists).
Move file1 from folder1 to folder2 (renaming file1 to file2):
Renaming file:
Moving directory:
Renaming directory:
You can use both cp and rm commands to move files.
First copy file1 from folder1 to folder2 and then delete file1 in folder1: