Linux: Files & Directories

Smart Panda - Linux Console

Linux is extremely powerful and has all sorts of cool features that make easy work of really difficult tasks. Here are just a couple to make working with files and directories easier.

Mount Point Drive Information/Usage:  

df -h

Directory size:

du -h

Number of files in a directory:

ls -l | grep ^- | wc -l

Number of directories in a directory:

ls -l | grep ^d | wc -l

List the 10 Largest Directories:

du -a /{path} | sort -n -r | head -n 10