Basic Shell Scripting in Linux to find file size

Hello Everyone, As My Previous Post are from Linux so, In This Post I will continue to Linux itself, Today we will Learn Simple tip to Check File Size from the Linux terminal.

Well there are many ways by which we can check the file size under Terminal, but today we will learn about stat command. To know More about stat command.
Open the Terminal ( Press Alt + Ctrl + T)

type "man stat" without quotes to know more details


it will display the details of stat
Now, to Know the size of the file situated in any directory , First Change the path to the Directory at which the file is present, ex:- if the file is in desktop type cd /home/aditya/Desktop

then type ls to display the list of files in this directory.

Now, 
type 
stat -c %s filename.txt

the extension could be any depending on the file type.
example:-

use this command to read in simple way

ls -lah fw8ben.pdf | awk '{ print $5}'




2 comments:

Give your Opinion !

Copyright © 2012 cyberaditya.