$ sort -t $'\t' -k 1rn,1 -k 2,2rn -k 3f,4 listaprezzi2050        900           bananas     51905        700           grapes      17250         4000          oranges     10230         9200          figs        4220         5000          lemons      10200         8000          pears       8I want to sort 1st column of listaprezzi numerically in reverse (option rn), 2nd also rn, and third alphabetically (f). What is the correct command?I've tried many ways but having no success.
How to sort columns independently?
text processing;sort;columns
If I correctly understand your question you want to rearrange your data, i.e. independently sort (up or down) different fields of the same row. You cannot do that with bare sort, you need to use additional tools, for example with the help of awk and paste you can write the following:$ paste <(awk '{print $1}' listaprezzi | sort -nr) <(awk '{print $2}' \  listaprezzi | sort -nr) <(awk '{print $3}' listaprezzi | sort) <(awk \  '{print $4}' listaprezzi)And the result is2050    9200    bananas   51905    8000    figs      17250     5000    grapes    10230     4000    lemons    4220     900     oranges   10200     700     pears     8