101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 43


Which of the following commands changes all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks and stores the result in newlist.txt?

Show Answer
Correct Answer: A

To change all CR-LF line breaks in the text file userlist.txt to Linux standard LF line breaks, and store the result in newlist.txt, you need to remove the Carriage Return (CR) characters and keep only the Line Feed (LF) characters. The `tr` command with the `-d ' '` option effectively deletes the CR characters. Therefore, the correct command is `tr -d ' ' < userlist.txt > newlist.txt`.

Discussion

5 comments
Sign in to comment
AdamCzepiel
Apr 21, 2023

checked, correct -> https://stackoverflow.com/questions/2613800/how-to-convert-dos-windows-newline-crlf-to-unix-newline-lf

JopieJo
Jul 19, 2023

Agree with opt A: Only delete (tr -d) the Carriage Return (CR) character (0x0D, \r) and leave the Line Feed (LF) character (0x0A, \n) in tact. tr -d '\r' <input file> <output file>

Ralf_G
Sep 1, 2024

The syntax salad that is given here as possible answers does not exist. The correct answer is: A) $ tr -d '\r' < userlist.txt > newlist.txt

Ninymo
Sep 24, 2024

Answer: A

b601c87Option: A
Apr 24, 2025

THIS QUESTION IS NOT THE SAME IN THE EXAM I DID IT YESTERDAY BUT YOU AHVE TO REMMBER THAT THE ANSWER IS A