Exam 1Z0-821 Topic 4 Question 16 Discussion

Actual exam question for Oracle's 1Z0-821 exam
Question #: 16
Topic #: 4
Given:
file1 and file2 are text files.
dir1 and dir2 are directories.
Which two commands will be successful?

Suggested Answer: C,F Vote an answer

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.

by Amy at Jan 22, 2024, 11:01 PM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10