DEV Community

Bijay Kumar Pun
Bijay Kumar Pun

Posted on

2

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)

Image of Stellar post

🚀 Stellar Dev Diaries Series: Episode 1 is LIVE!

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more