exam questions

Exam 010-160 All Questions

View all questions & answers for the 010-160 exam

Exam 010-160 topic 1 question 39 discussion

Actual exam question from LPI's 010-160
Question #: 39
Topic #: 1
[All 010-160 Questions]

A directory contains the following three files:
texts 1.txt
texts 2.txt
texts 3.csv
Which command copies the two files ending in .txt to the /tmp/ directory?

  • A. cp ??.txt /tmp/
  • B. cp *.txt /tmp/
  • C. cp. \.txt /tmp/
  • D. cp ?.txt /tmp/
  • E. cp $?.txt /tmp/
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Styles
Highly Voted 4 years, 6 months ago
*. txt means all the txt files
upvoted 18 times
...
sasquatchshrimp
Highly Voted 3 years, 9 months ago
B is the correct answer. the "*" is a "wildcard" meaning it looks for anything with .txt at the end.
upvoted 8 times
...
Jay987654
Most Recent 8 months, 3 weeks ago
Selected Answer: B
The correct answer is B! B - "cp *.txt /tmp/" is the command for copying all files ending in ".txt" to the "/tmp/" directory. This is a wildcard match, which means that any file in the current directory with a ".txt" extension will be copied.
upvoted 3 times
...
TacosInMyBelly
9 months, 2 weeks ago
Selected Answer: B
As stated before, "*" selects all .txt files, while "?" is for exactly one character such as "1.txt"
upvoted 2 times
...
emigrin14
11 months, 3 weeks ago
Selected Answer: D
Both B and D results in the same solution. Considering both 1.txt and 2.txt has exactly one character before ".txt", the question mark ? in answer D results in matching those two files in the resolution. That being said, the aserisk * in answer B also matches AT LEAST 1 character before ".txt".
upvoted 2 times
...
Nunjamin
4 years, 7 months ago
cp ?.txt /tmp/ would also copy the two .txt files wouldn't it?
upvoted 3 times
WaldoWhereAmI
4 years, 6 months ago
No ? = Matches up exactly one character
upvoted 12 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago