Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 962 Bytes

cp.md

File metadata and controls

36 lines (29 loc) · 962 Bytes
title description created updated
cp Linux Command
cp stands for copy. This command is used to copy files or directories. cp command require at least two filenames in its arguments.
2019-08-26
2019-08-26

cp stands for copy. This command is used to copy files or directories. cp command require at least two filenames in its arguments.

Syntax

cp [OPTION] SourcePath DestinationPath

Options

Option Description
-a archive files
-f force copy by removing/overriding the destination file (if already present)
-i interactive mode override (asks before overwrite)
-l linkes the files instead copy
-L follows symbolic links
-n no file overwrite, if destination file already exists
-R recursive copy (this includes hidden files)
-u update mode i.e copy only when source is newer than dest
-v verbose mode i.e prints more information

Example

$ cp file1.txt file2.txt
$ ls
file1.txt	file2.txt