Skip to main content
deleted 9 characters in body
Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

Short Awk approach:

lsblk -nbio KNAME,TYPE,SIZE,MODEL | awk '$3>3e11' 

  • -n (--noheadings) - don't print headings

  • $3 - the 3rd field (SIZE column)

  • 3e11 - E-notation. the letter E (or e) is often used to represent "times ten raised to the power of" (which would be written as "× 10n") and is followed by the value of the exponent; in other words, for any two real numbers m and n, the usage of "mEn" would indicate a value of m × 10n. 3e11 is equivalent to 300000000000.

Short Awk approach:

lsblk -nbio KNAME,TYPE,SIZE,MODEL | awk '$3>3e11' 

  • -n (--noheadings) - don't print headings

  • $3 - the 3rd field (SIZE column)

Short Awk approach:

lsblk -nbio KNAME,TYPE,SIZE,MODEL | awk '$3>3e11' 

  • -n (--noheadings) - don't print headings

  • $3 - the 3rd field (SIZE column)

  • 3e11 - E-notation. the letter E (or e) is often used to represent "times ten raised to the power of" (which would be written as "× 10n") and is followed by the value of the exponent; in other words, for any two real numbers m and n, the usage of "mEn" would indicate a value of m × 10n. 3e11 is equivalent to 300000000000.

deleted 9 characters in body
Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

WithShort Awk approach:

lsblk -bionbio KNAME,TYPE,SIZE,MODEL | awk 'NR==1;NR>1 && $3>300000000000''$3>3e11' 

  • -n (--noheadings) - don't print headings

  • $3 - the 3rd field (SIZE column)

With Awk:

lsblk -bio KNAME,TYPE,SIZE,MODEL | awk 'NR==1;NR>1 && $3>300000000000' 

Short Awk approach:

lsblk -nbio KNAME,TYPE,SIZE,MODEL | awk '$3>3e11' 

  • -n (--noheadings) - don't print headings

  • $3 - the 3rd field (SIZE column)

Source Link
RomanPerekhrest
  • 30.9k
  • 5
  • 47
  • 68

With Awk:

lsblk -bio KNAME,TYPE,SIZE,MODEL | awk 'NR==1;NR>1 && $3>300000000000'