The sort command is used to sort the lines of a file or a stream of input according to a specified criterion, such as alphabetical order, numerical order, reverse order, etc. By default, the sort command sorts the lines in ascending alphabetical order, using the firstcharacter of each line as the key. For example, the command sort data.csv will sort the lines of the file data.csv in alphabetical order and display the output on the screen. If you want to save the sorted output to a new file, you can use the redirection operator (>) to specify the output file name. For example, the command sort data.csv > sorted_data.csv will sort the lines of the file data.csv in alphabetical order and save the output to a new file named sorted_data.csv. The other commands are either invalid or do not perform the sorting operation. The a…z command does not exist, the abc command is a text editor, the wc command counts the number of words, lines, and bytes in a file, and the grep command searches for a pattern in a file or a stream of input. Therefore, the correct answer is B. References:
Linux Essentials - Linux Professional Institute (LPI), section 2.3.2
LPI Linux Essentials Study Guide: Exam 010 v1.6, 3rd Edition, chapter 4, page 95.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit