Which of the following commands puts the lines of the file data.csv into alphabetical order?
A.
a..z data.csv
B.
sort data.csv
C.
abc data.csv
D.
wc -s data.csv
E.
grep --sort data.csv
The Answer Is:
B
This question includes an explanation.
Explanation:
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.
010-160 PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 60% Discount on All Products,
Use Coupon: "8w52ceb345"