Copying, Moving and Deleting Files

In either OS, make sure you are in the directory called CLI.

The format of the copy command is cp source destination

This will copy from an existing file (source) to a new file (destination) leaving the original file where it was.

To move a file, the command in Unix is mv source destination, this will move an existing file (source) to a new location (destination) removing the original file

To delete a file in Unix, the format of the command is rm filename This will delete a file (filename)

Exercise

In both operating systems

  1. Copy the file rubbish.txt to a new file name rubbish.bak

  2. Copy the file rubbish.txt to a new file name rubbish.del

  3. Copy rubbish.bak to the \CLI\Backup directory

  4. Delete rubbish.del