Unix Commands: mv and cp
Posted 01/23/2011 at 3:29pm
| by Cory Bohon

These two commands are used to move and copy files.The first, mv is used to move files from one location to another. Let’s say that I had a file located in my user folder, but I wanted it moved to a folder called Documents. I would use the mv like this:
mv ~/test.txt ~/Documents/test.txt
This will move the file from the first location that you specified to the second location.
Let’s say that instead of moving the file from the first location to the second location, you wanted to copy it. That’s easy enough. Just replace the mv command with the cp command, like this:
cp ~/test.txt ~/Documents/test.txt