We can perform sorting on secondary key also using sort command.

Answer: a
Explanation: We can sort on more than one fields i.e. we can provide a secondary key to sort. For example, if the primary key is the third field and the secondary key is the second field, then we have to specify for every -k option, where the sort ends. This is done in the following manner:
Code:
$ sort -t “|” -k 3,3  -k 2,2   shortlist
This command will sort the file according to the second and third field. 3,3 indicates that sorting starts and end on the third field.
 

Tìm kiếm

Back
Top