Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 <<ERR
  • 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 (?) , you can switch to a simple comment.
Switch to a voting comment New
CuriousLinuxCat
Highly Voted 2 years, 10 months 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 1 month, 1 week ago
Answer: C
upvoted 1 times
...
okamigo
3 years ago
C it's not correct answer I think E it wright answer
upvoted 1 times
anhcq
2 years, 5 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
SScott
2 years, 5 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 ...