Copying a File with cp

To copy a file named testfile from ~/Documents to ~/Downloads, use this command:

To copy a file that is in your current directory, you could use the following, and it will work exactly the same as mv, except that both files will exist afterward:

To rename a file as you copy it form ~/Documents to ~/Downloads, you could use this:

Or from anywhere using an absolute path, you could use the following command:

Or from anywhere using a path shortcut, you could use this:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s