Friday, May 4, 2012

Easy learn linux command line- Part 6

Hi, in this post we learn how to find some information about our Hard Drives like: size,directory Space, mounted Partitions and ... .


Disk Space

Command Description
# df -h show list of partitions mounted   
# dpkg-query -W -f='${Installed-Size;10}t${Package}n' | sort -k1,1n show the used space by installed deb packages, sorting by size (debian, ubuntu and alike)   
# du -sh dir1 estimate space used by directory 'dir1'   
# du -sk * | sort -rn show size of the files and directories sorted by size   
# ls -lSr |more show size of the files and directories ordered by size   
# rpm -q -a --qf '%10{SIZE}t%{NAME}n' | sort -k1,1n show space used by rpm packages installed sorted by size (fedora, redhat and like)