How To Find Large Files on Linux

How To Find Large Files on Linux

Posted on


We’ve all got to that point on a given system where we start to run out of storage space. Do we buy more storage, perhaps one of the best SSDs, or do we search and find the largest files quickly? In this how to we will look at a few simple approaches to help us maintain and manage our filesystems.

All the commands in this article will work on most Linux machines. We’ve used a Ubuntu 20.04 install but you could run this how-to on a Raspberry Pi. All of the how-to is performed via the Terminal. If you’re not already at the command line, you can open a terminal window on most Linux machines by pressing ctrl, alt and t.

Listing Files In Size Order Using the ls Command in Linux

(Image credit: Tom’s Hardware)

The ls command is used to list the contents of a directory in Linux. By adding the -lS argument we can  order the returned results according to the file size. We have copied a collection of files into a test directory to show this command but it can be run in any directory you choose.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *