see the size of files and folders
How much room each file and folder takes, here or anywhere, biggest last.
Steps
-
du -sh *the size of each file and folder here
-
du -sh .[!.]* *the same, hidden ones included
-
du -h -d 1 | sort -hthe folders here, sorted by size, biggest last
-
du -sh folderthe total size of one folder
-
ls -lhSthe files here, biggest first
-
ncdubrowse sizes folder by folder, if ncdu is installed
Commands used
duncdulsdf
Each has a page in lore: lore du opens it.
Related recipes
- create a large fileMake a file of a given size, for testing disks, uploads or swap.
- disk full but df says there is room"No space left on device" with free gigabytes: the disk is out of inodes, the slots for files. Find the folder with too many small files.
- find big filesFind the files that take the most room, on a whole disk or in a folder.
- free disk spaceFind what fills a disk, then clear what is safe to clear: old package files, logs, caches.