Unix - Engineering

Q1:

Which command is used to sort the lines of data in a file in reverse order

A sort

B sh

C st

D sort -r

E None of the above

ANS:D - sort -r

Sort command is basically used for "ordering a file".

- Reverses sort order(-r).
- Sorting on primary key(-k).
- Numeric sort(-n).
- Removing repeated lines(-u).

These are the sorting options.