1Z0-821 · Question #116
Given: file1 and file2 are text files. dir1 and dir2 are directories. Which two commands will be successful?
The correct answer is C. cp file? dir1 F. cp file1 file2 dir1. C: Here the wildcard character ? is used (Matches any single character). file1 and file2 will be copied into dir1 F: the two files file1 and file2 are copied into directoy dir1. Note: cp - copy files and directories Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Cp…
Question
Given:
file1 and file2 are text files. dir1 and dir2 are directories. Which two commands will be successful?
Options
- Acp dir1 dir1
- Bcp dir1 file1
- Ccp file? dir1
- Dcp file. dir1
- Ecp file% dir2
- Fcp file1 file2 dir1
How the community answered
(43 responses)- A2% (1)
- B2% (1)
- C81% (35)
- D9% (4)
- E5% (2)
Explanation
C: Here the wildcard character ? is used (Matches any single character). file1 and file2 will be copied into dir1 F: the two files file1 and file2 are copied into directoy dir1. Note: cp - copy files and directories Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Cp has three principal modes of operation. These modes are inferred from the type and count of arguments presented to the program upon invocation. * When the program has two arguments of path names to files, the program copies the contents of the first file to the second file, creating the second file if necessary. * When the program has one or more arguments of path names of files and following those an argument of a path to a directory, then the program copies each source file to the destination directory, creating any files not already existing. * When the program's arguments are the path names to two directories, cp copies all files in the source directory to the destination directory, creating any files or directories needed. This mode of operation requires an additional option flag, typically r, to indicate the recursive copying of directories. If the destination directory already exists, the source is copied into the destination, while a new directory is created if the destination does not exist.
Topics
Community Discussion
No community discussion yet for this question.