Which option is used for sorting a file according to primary key?

Answer: b
Explanation: sort command provides an option for sorting file according to our specified field. For this purpose, we have to use -k along with the field number (based on which we want to perform sorting). For example, to perform sorting on second field (name):
Code:
$ sort -t “|” -k 2  file01
1243|Abd    |01 |98%
2345|Mash |10 |65%
2390|Ryan  |03 |76%
 

Tìm kiếm

Back
Top