CertNexus Certified Cyber Secure Coder (CSC) — Question 88
An incident responder has collected network capture logs in a text file, separated by five or more data fields. Which of the following is the BEST command to use if the responder would like to print the file (to terminal/screen) in numerical order?
Answer options
- A. cat | tac
- B. more
- C. sort –n
- D. less
Correct answer: C
Explanation
The correct answer is C, 'sort –n', which sorts the lines of text numerically based on the first field. Option A, 'cat | tac', simply reverses the order of the lines, while B and D, 'more' and 'less', are used for paging through text but do not sort the contents.