Google News
logo
Unix - Quiz(MCQ)
What is the function of cp command in Unix?
A)
delete a given file
B)
change the directory
C)
list all the available files in the current directory
D)
cp is a command used for copying files and directories

Correct Answer :   cp is a command used for copying files and directories


Explanation : cp command is basically used for creating a copy of source file or a group of files. The syntax of the command requires at least two filenames to be specified. If both the files specified are ordinary files, the first file will be copied to the second file. The syntax of cp command is cp source_filename destination_filename. The contents of the source file will be copied to the destination file in the same directory.

$ cp  file_01  file_02               // copies file_01 to file_02​

Advertisement