DEV Community

Bijay Kumar Pun
Bijay Kumar Pun

Posted on

Linux Test Session: Sorting with $sort

$sort

$(du / | sort -nr | head -n 10)

  • du shows disk usage at root directory ( a huge huge file)
  • sort -nr sorts the file numerically in reverse order
  • head -10 shows only the top 10 sorted lines
  • () pushes it to the sub-shell in the background

Top comments (0)