CSC373/406: linux: cp: Copy a file [21/42] Previous pageContentsNext page

Arguments: existing_file new_copy

Description: Copy existing_file to the file new_copy. If new_copy doesn't exist, create it. If it does exist, first delete its contents.

If new_copy is a directory, a copy of existing_file is created in directory new_copy with the same file name - existing_file.

Example:

$ cp sample.cpp prog1.cpp

Previous pageContentsNext page