Check file size in human understandable format (KB, MB and GB’s)

Generally we list contents of current directory with the ls command in our terminal. To see more detail we can use ls -l command to see author of file, permissions, size in bytes.

But for humans to easily understand the file size we can list the files with sizes in Kilobytes, Megabytes and Gigabytes (when applied) with:

ls -lh

But it lists file sizes good but not the directories. So for the directories:

du -h .

Replace . (dot) with the directory you want.

To see file system disk space usage:

df -h

 To know more about these commands you can always do man <command_name>.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s