Convert block size to mb


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Convert block size to mb
# 1  
Old 06-07-2005
Convert block size to mb

If I execute this command:
$ ls -lt | awk '{print $5}' | sort -nr |head -1

it returns the following value
57441881

If I execute this command:
$ ls -s | sort -nr | head -1 | cut -d" " -f1

it returns the same file but now in block size
112208

Is there a way I can calculate what the size in mb one block of data is? I want to create a shell script that has an "if block size > a hard-coded amount, do something. I want to translate block size into mb so that the rest of the team can understand what I am doing.

I tried 112208/57441881. This out put does not appear to be corrrect.

Your help will be highly appreciated.
# 2  
Old 06-07-2005
To paraphase a recent statesman, it depends on what the meaning of MB is... 2^20 or 10^6? I use 2^20 so:
57441881 / 1048578 = 112208 / 2048 = 54
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

About Block Size and Fragment Size

Accordingly a lot of manuals - if you have block size 8KB and trying to write a 1KB file to the block, as result you waste 7KB of the block space. But recently I noticed about Fragments of File Block. In same case if you have File Block 8KB and Fragment size 1KB - you can save your block space,... (6 Replies)
Discussion started by: jess_t03
6 Replies

2. Red Hat

O/s block size

Hi Guys, I am running Linux 2.6.18-164.el x86_64 how do i check the block size? Thanks in advance... (1 Reply)
Discussion started by: Phuti
1 Replies

3. UNIX for Advanced & Expert Users

Physical disk IO size smaller than fragment block filesystem size ?

Hello, in one default UFS filesystem we have 8K block size (bsize) and 1K fragmentsize (fsize). At this scenary I thought all "FileSytem IO" will be 8K (or greater) but never smaller than the fragment size (1K). If a UFS fragment/blocksize is allwasy several ADJACENTS sectors on disk (in a ... (4 Replies)
Discussion started by: rarino2
4 Replies

4. Shell Programming and Scripting

convert file storage size from one unit of measurement to another

The source number is always in megabytes and I need a script to covert into either MB,GB or TB displayed in a specific format. Source number examples: 5345376635 34255 5453645846353 The result has to be maximum 2 numbers after the comma 1.13 TB 134.17 TB 413.46 GB 678.45 MB I... (3 Replies)
Discussion started by: TehOne
3 Replies

5. AIX

Block Size

Hi, I try to change the block size from 512 to 0, but it send this message: 0514-068 Cause not know Can someone help me whith this? (3 Replies)
Discussion started by: Ruben78
3 Replies

6. UNIX for Dummies Questions & Answers

block size

Hi All, drwxr-xr-x 2 root root 4096 May 31 14:47 test Please let me know here 4096 indicating what? Thanks & Regards, Bache (1 Reply)
Discussion started by: bache_gowda
1 Replies

7. UNIX for Dummies Questions & Answers

How to know the OS Block size

Hello Unix guru's I want to check my OS Block size for the Solaris 8 Following is one of the line from df -g command. Can anybody help to interpret the same. /u03 (/dev/vx/dsk/oradg/vol03): 8192 block size 8192 frag size 205463552 total blocks 50433792... (1 Reply)
Discussion started by: Dilippatel
1 Replies

8. Solaris

block size

how do you determine block size for a file system? In solaris 5.8 (3 Replies)
Discussion started by: csaunders
3 Replies

9. Filesystems, Disks and Memory

os block size

AIX 4.3.3 How can I find the os block size? How can I change the OS Block Size? When and where does the os block size get set? I am running oracle 8.1.7 and am under the impression I need to set my os block size = oracle block size which is 8k. Any insight on this would be... (1 Reply)
Discussion started by: kburrows
1 Replies

10. Filesystems, Disks and Memory

block size

Hi, Somehow i have forgotten a comand that displays me the block size of the unix filesystem. Can someone letme know this command regards penguin (5 Replies)
Discussion started by: linuxpenguin
5 Replies
Login or Register to Ask a Question