Bracing against the wind  
www.documentroot.com  

Tuesday, June 16, 2015

Get block size bash

Probe for block size. Useful when you've probably got no tools. Like when trying to optimize sqlite paging at run-time.
function block_size() {( 
   [ "$1" ] && cd $1; echo 1 > block_size.tmp;  
   ls --block-size 1 -s block_size.tmp | cut -f 1 -d ' '; 
   rm block_size.tmp; 
)}

[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Home | Email me when this weblog updates: | View Archive

(C) 2002 Erik Aronesty/DocumentRoot.Com. Right to copy, without attribution, is given freely to anyone for any reason.


Listed on BlogShares | Bloghop: the best pretty good | Blogarama | Technorati | Blogwise