exam questions

Exam 101-500 All Questions

View all questions & answers for the 101-500 exam

Exam 101-500 topic 1 question 55 discussion

Actual exam question from LPI's 101-500
Question #: 55
Topic #: 1
[All 101-500 Questions]

Which of the following commands redirects the output of ls to standard error?

  • A. ls >-1
  • B. ls <
  • C. ls >&2
  • D. ls >>2
  • E. ls |error
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
CuriousLinuxCat
Highly Voted 3 years ago
@okamigo, E is absolutely false because it isn't even using the re-directional symbol (>). The correct answer is C. D is wrong because the append symbol (>>) cannot append to STDERR(2). It needs a file to append the out of 'ls' to.
upvoted 8 times
...
Ninymo
Most Recent 3 months, 3 weeks ago
Answer: C
upvoted 1 times
...
okamigo
3 years, 3 months ago
C it's not correct answer I think E it wright answer
upvoted 1 times
anhcq
2 years, 8 months ago
nope, E ls |error, this command redirect output of ls command to error command which is not found. answer C is correct
upvoted 2 times
[Removed]
2 years, 8 months ago
C is correct: ls>&2 sends the ls output to the 2 (stderr) location A, B, D, and E are wrong: ls>-1 creates a file -1 that is the output of ls <<ERR sets the ERR string as the end of input ls>>2 would append to a file '2' ls |error is an invalid command
upvoted 3 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