Copying works similarly to moving, but retains the original in the original location. To copy a file named
~/archive, use this command:
matthew@seymour:~$ cp documents/filename archive
Notice that the filename is not included in the destination. The destination here must be an existing directory. If it is not, the file is renamed to the term used. Some examples will make this clear.
To copy a file that is in my current directory I could use the following, and it will work exactly the same as
mv, except that both files will exist afterward:
matthew@seymour:~$ cp oldfilename newfilename
To rename a file as I copy it from