Symas OpenLDAP Knowledge Base

DF vs DU HDD Partition Analyzer

du = Disk Usage

Notes:

It walks through directory tree and counts the sum size of all files therein. It may not output exact information due to the possibility of unreadable files, hardlinks in directory tree, etc. It will show information about the specific directory requested. Think, “How much disk space is being used by these files?”

Options:

-h Quantifies directory sizes into (K)ilobytes, (M)egabytes, (G)igabytes and (T)erabytes -sh Limits results to current directory (requires sudo to avoid permission errors) -a Returns disk usages for all files in current directory and subdirectories * Returns disk usage for all files in current directory only (can also be used as a wildcard -h s* which would return disk usage for files starting with S or -h *.gif which would return disk usage for all gif files) -c Adds total disk usage to bottom of results (-hc adds quantifiers to file sizes) –max-depth=1 Determines how many subdirectories are included in the search | sort -n Sorts results from smallest to largest | less Outputs results to less viewer for easier reading (can be included with | sort -n) | grep Searches results for specific items and displays only them –help Opens DF helpfile –version Opens DF installed version information

df = Disk Free

Notes:

Looks at disk used blocks directly in filesystem metadata. Because of this it returns much faster that du but can only show info about the entire disk/partition. Think, “How much free disk space do I have?”

Options:

-h Quantifies directory sizes into (K)ilobytes, (M)egabytes, (G)igabytes and (T)erabytes -i Outputs Filesystem, Inodes, IUsed, IFree, IUse% and Mounted on information for directory specified -a Includes files with zero files size in the output -T Includes the filesystem type with the output –help Opens DF helpfile –version Opens DF installed version information