Find heavier file on my operating system

New to Debian (Or Linux in general)? Ask your questions here!

Find heavier file on my operating system

Postby Deblib » 2018-06-13 09:20

Hi, I would like to know how I can find the file that weighs the most on my hard drive (and how much it weighs).
Thanks!
Deblib
 
Posts: 102
Joined: 2016-05-14 14:41

Re: Find heavier file on my operating system

Postby Dai_trying » 2018-06-13 10:26

I found ncdu does a great job.
Dai_trying
 
Posts: 557
Joined: 2016-01-07 12:25

Re: Find heavier file on my operating system

Postby Deblib » 2018-06-13 20:22

Great tool! :)
But, would it be possible with the command find or similar by the Terminal?
Deblib
 
Posts: 102
Joined: 2016-05-14 14:41

Re: Find heavier file on my operating system

Postby sunrat » 2018-06-13 22:58

This will list files in CWD in size order:
Code: Select all
du -sh * | sort -hr
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2461
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Find heavier file on my operating system

Postby debiman » 2018-06-14 05:28

Deblib wrote:Great tool! :)
But, would it be possible with the command find or similar by the Terminal?

yes.
User avatar
debiman
 
Posts: 3017
Joined: 2013-03-12 07:18

Re: Find heavier file on my operating system

Postby Dai_trying » 2018-06-14 07:06

debiman wrote:
Deblib wrote:Great tool! :)
But, would it be possible with the command find or similar by the Terminal?

yes.

To expand on this a little, you can use find to do this but you will obviously need to do some filtering and/or sorting of the results to get the information you want.

If you just want to largest file you could use sort and then tail to give only the first (or last depending on sort order) result, but this might use a lot of resources, especially if you are using find from the root of your system as it would sort ALL the results of find.
Dai_trying
 
Posts: 557
Joined: 2016-01-07 12:25


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable