Author Archives for Trevor

Disk Usage/Size


All files/folders with sizes; Total size at bottom du -h </path/to/directory> One line, shows top level folder size including sub-folders/files. du -hs </path/to/directory> Total folder/file size recursive for multiple folders du -sch </path/to/directory> </path/to/directory> </path/to/directory> Show directory tree structure from directory down with count tree -sd </path/to/directory>

Find large files in Linux


My favorite one-liner to do this find / -type f -size +10M -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’ From the Linux Man page for ‘find’, size can be set to the following: ‘b’    for 512-byte blocks (this is the default if no suffix is used) ‘c’    for [...]