Move files and/or folders.

      mv [options] source target

     -n     Do not overwrite any existing file.

     -i     Prompt before moving a file that would overwrite an existing file.
            A response `y' or `Y', will allow the move to proceed
            (writes to standard error)

     -f     Always Overwrite destination files
            (Do not prompt for confirmation)

     -v     Verbose, show filenames.

The -n and -v options are non-standard and their use in scripts is not recommended.


Move all files with names ending in ".jpg" from the current folder to the Documents directory
$ mv *.jpg ~/Documents

Move the "Documents" folder to "Documents backup", quotes are needed because of the space in the folder name.
$ mv Documents "Documents backup"

Move all .jpg files to the CA folder, and for those with "New York" in the filename, replace with "California_"
the "${f/New York/California_}" is an application of bash parameter expansion.

$ mkdir CA
$ for f in *.jpg; do mv "$f" "CA/${f/New York/California_}"; done

Rename .txt files to .html
$ for f in *.txt; do mv ./"$f" "${f%txt}htm"; done

“Any intelligent fool can make things bigger and more complex, and more violent. It takes a touch of genius - and a lot of courage to move in the opposite direction” - Albert Einstein


mv man page -
cp - Copy files
CpMac - Copy a file while preserving metadata and forks (Developer Tools)
copy - Copy groups of files in folders
dd - Data Dump - convert and copy a file (use for RAW storage)
install - Copy files and set attributes
MvMac - Copy a filewhile preserving metadata and forks (Developer Tools)
tar - store or extract files to an archive (allows symbolic links to be copied as links)

© Copyright 1999-2015
Some rights reserved