How to Move and Copy items in the system/Mac using Terminal?

Moving file/folder -> MV command can be used to move files or folders from one location to another or move to a new location.

Moving the file into a different folder. -> mv /work/product.txt /docuemtn/Work/product.txt

change the file name and move to a different location -> mv ~/Downloads/MyFile.txt ~/Documents/Work/NewFileName.txt

How to copy files and directories >

Copy the file from the Desktop folder and paste it into the document folder

cp ~/Desktop/product.txt ~/Documents

Copy all files and folders into the target folder (-R mean all item in the folder)

cp -R ~/Desktop/test1 /Documents

How to copy or move multiple files

cp ~/Desktop/*.txt ~/Documents

Leave a Comment

Your email address will not be published. Required fields are marked *