• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. Using Basic Unix Commands > Copying and Moving Files

Copying and Moving Files

Copying files is almost as easy as creating a new folder. All you have to do is know the name of the file that you want to copy (and it's path), and the name and path you want it copied to. Moving files works the same way. The difference is when you copy a file, the original item stays put, and a copy is placed somewhere else. You can also create a copy of a file and leave it in the same location, you'll just need to rename the file. When you move a file, you are removing it from its original location and placing it somewhere else. Copying files uses the cp (copy) command, and moving files uses the mv (move) command.

Copy a File with a New Name

Open the Applications folder, double-click the Utilities folder, and then double-click the Terminal icon.

Type cp filename.ext newfilename.ext, and then press Return.

In our example, UNIX makes a copy of the file with a new name of macOldConf.

Click the Close button.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint