mv

GNU mv Cheatsheet #

mv is a command used to move or rename files and directories on GNU systems.

Basic Usage #

Command/OptionExampleDescription
mv source destmv file1.txt file2.txtRename file1.txt to file2.txt
mv source dest/mv file.txt /path/to/dir/Move file.txt to /path/to/dir/
mv source1 source2 dest/mv file1.txt file2.txt /path/to/dir/Move file1.txt and file2.txt to /path/to/dir/

Options #

Command/OptionExampleDescription
-imv -i file.txt /path/to/dir/Prompt before overwriting files
-fmv -f file.txt /path/to/dir/Force move by overwriting files without prompt
-umv -u file.txt /path/to/dir/Move only when the source file is newer than the destination file
-vmv -v file.txt /path/to/dir/Verbose mode, show the move operation

Examples #

Command/OptionExampleDescription
mv -imv -i oldname.txt newname.txtPrompt if newname.txt exists
mv -fmv -f file.txt /path/to/dir/Forcefully move file.txt to /path/to/dir/
mv -umv -u file.txt /path/to/dir/Move file.txt only if it is newer

This cheatsheet covers essential mv commands and options for GNU systems.

mv

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.