• -g: To sort scientific-notation values in the eleventh column: sort -g -k11

  • What does the numeric option mean? sort -k2,2 : use the fields from #2 to #2 sort -k2n,2: sort by the numeric value of the second field

  • -f: case-insensitive text comparison

  • -r: reverse

  • -t: set the field separator; default field handling uses whitespace

  • Default lexical sorting: awk -F"\t" '{print $2}' subeset_product.txt | sort -u

    Product_1
    Product_10
    Product_2
    Product_3
    Product_4
    Product_5
    Product_6
    Product_7
    Product_8
    Product_9

    → numeric sort: awk -F"\t" '{print $2}' subeset_product.txt | sort -u -n → but here we need version sort: awk -F"\t" '{print $2}' subeset_product.txt | sort -u -V

Product_1
Product_2
Product_3
Product_4
Product_5
Product_6
Product_7
Product_8
Product_9
Product_10
← Back to all posts