I am working on Lubuntu. Recently I noticed that my disk space is shrinking badly even though it was quite ok at the begin. I remove all tmp, unused apps, downloads and it still gave me almost nothing. Is there a tool (preferably graphical but not necessary) to get some kind of report of directory sizes (even better: recursively so I can run a test and then check subdirs to find the "guilty one")?
4 Answers
I recommend using the command du
you may want to use the -h
flag so its human readable. So thusly I recommend:
du -h
This will give you a very long list of sizes and paths.
Good luck!
-
+1 I use this version that shows the largest files last:
du -hs * | sort -h
Sep 27, 2016 at 18:29 -
I'd suggest
du -h -t 1G | sort -h
because it'll only list directories bigger than 1GB. Sep 27, 2016 at 18:33
Or you can try this: https://apps.ubuntu.com/cat/applications/natty/baobab/ :)
It shows you all folders in system and they size.
Don't worry, there is a quick and safe solution, just follow this mini-guide.
Open a bash terminal (CTRL
+ALT
+t
), copy-paste the following command inside it and press ENTER
:
du --human-readable --max-depth 5 --one-file-system ~ | grep ^[0-9\,\.]*[M\|G\|T].*$ | zenity --list --title="Huge files" --column=Files --text= --editable&
This is a simple script that shows a window with a list of all big files: click on an entry to select and copy the file path, find the file and then delete it. The script does NOT delete the files, do it manually after checking if you need to do a backup and remember to empty the trash.
NOTE: I've made the script 5 minutes ago and is very "spartan", please report any bug in the comments, thank you. ;-)
NOTE: execute sudo apt-get install zenity
if you get a "missing command" error.
I think this could help you.
In Terminal df -h
See more at: http://www.makeuseof.com/tag/how-to-analyze-your-disk-usage-pattern-in-linux/
-
1Not really because I get just
/dev/sda1
as for my drive without info what exactly takes most space... Sep 29, 2016 at 13:18
du -h -t 1G | sort -h
because it'll only list directories bigger than 1GB.