DEV Community

Ali Reza
Ali Reza

Posted on

1

List of the largest files and folders in linux

To get the list of the largest files and folders, we use several commands together :

Commands:

  • du: The 'du' command in Linux is used to estimate file and directory space usage.
  • pipeline( | ): The Pipe is a command in Linux that lets you use two or more commands such that output of one command serves as input to the next.
  • grep: Grep is a useful command to search for matching patterns in a file.
  • sort: SORT command is used to sort a file, arranging the records in a particular order.
  • head: The 'head' command in Linux is used to display the first part of files

Now use this command together:

du -ah / | grep -v "/$" | sort -rh | head -10

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more