[Linux][Bash]How to know the size of a file from the command line?

Posted: May 4, 2013 in Linux Tips
Tags: , , ,

I was trying to take a complete database backup of a server using the command line and I wanted to test it out by checking out the size of the file. Soon I  was pulling my hair out trying to figure how to know the size of a file from the command line.

Finally I landed on this gem.

du -h <file-name>

‘du’ is the name of the program and  -h displays the output in ‘human readable’ format

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