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?
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?
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`.
checked, correct -> https://stackoverflow.com/questions/2613800/how-to-convert-dos-windows-newline-crlf-to-unix-newline-lf
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>
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
Answer: A
THIS QUESTION IS NOT THE SAME IN THE EXAM I DID IT YESTERDAY BUT YOU AHVE TO REMMBER THAT THE ANSWER IS A