Moving Files with Terminal
Advanced, Article, Mac OS X, Terminal | April 17th, 2008
Terminal makes it quick and easy to move files around Mac OS X. This quick tutorial will explain the move command and its uses
Warning: Using Terminal can be very dangerous and is for advanced users only. Be very, very careful with what you do in Terminal as you can cripple your Operating System.
The mv (move) command is your key to moving files and directories around the file system. Your basic command will look like mv path/to/file.ext path/to/newlocation/file.ext
In the example below I am going to move a file from my Documents folder to my Desktop.
- First I cd (change directories) into Documents by entering
cd Documents/
- Now that I’m in my Documents folder I’ll move my file to the desktop by entering
mv myFile.txt ~/Desktop/myFile.txt
- Next I’ll change directories to my Desktop folder and use the ls (list) command to see that my file has been successfully moved.

As you can see the file has been successfully moved to the Desktop. In this tutorial I used the cd command to change to my desired directory before moving my file, but technically I could just issue the command from any location as long as I know the path. For example, to do the same command if I were in a different directory, I would enter mv ~/Documents/myFile.txt ~/Desktop/myFile.txt This is great because you don’t have to actually navigate to the directory as long as you know the path.
![Validate my RSS feed [Valid RSS]](http://www.anythingapple.net/wp-content/themes/anythingapple/images/valid-rss.png)