DEV Community

Ali Reza
Ali Reza

Posted on

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)