Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question

Status
Not open for further replies.

uadmin

Technical User
Jun 13, 2001
122
GB
Hi
This is really simple i geuss when in directory you do a du -s and the size of the file comes back as "1662172" what is the format to convert to megs.

Is it the case of dividing by a 1024.

Regrads
Simon Simon Peter Wickham
Email: s.wickham@zoom.co.uk
 
The default is 512 byte blocks so to convert to megs, you need to divide by 2000. However most unix flavours have a du -sk option which returns the output in kilobytes, so if you need megabytes, just drop the last three characters

e.g
du -s returns 10000 blocks
du -sk would return 5000 k
both of which equate to 5 megs
 
Thank you for the help.

Regards
Simon Simon Peter Wickham
Email: s.wickham@zoom.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top