The mv command moves or renames files and folders on Linux systems, including Ubuntu.. If you use the -b or –backup options, the mv will rename the destination file if it exists, appending a suffix to its file name.. this prevents overwriting existing files..
What is mv command used for?
mv (short for move) is a Unix command that moves one or more files or directories from one place to another. If both filenames are on the same filesystem, this results in a simple file rename; otherwise the file content is copied to the new location and the old file is removed.
What is the difference between cp and mv command in Linux?
The cp command will copy your file(s) while the mv one will move them. So, the difference is that cp will keep the old file(s) while mv won’t.