nerdexam
LPI

101-400 · Question #134

Which of the following commands will change all CR-LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt?

The correct answer is C. tr -d '\r' < userlist.txt > newlist.txt. See the full explanation below for the reasoning.

Question

Which of the following commands will change all CR-LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt?

Options

  • Atr '\r\n' '' < userlist.txt > newlist.txt
  • Btr -c '\n\r' '' < newlist.txt > userlist.txt
  • Ctr -d '\r' < userlist.txt > newlist.txt
  • Dtr '\r' '\n' userlist.txt newlist.txt
  • Etr -s '^M' '^J' userlist.txt newlist.txt

How the community answered

(45 responses)
  • A
    4% (2)
  • B
    11% (5)
  • C
    80% (36)
  • D
    2% (1)
  • E
    2% (1)

Community Discussion

No community discussion yet for this question.

Full 101-400 Practice