D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Checking size of file and running command depending on size

 

Hi folks,

I'm trying to write a bash script to check if a file is larger than a  
certain size (say 15KB) and if it isn't to run another command.

The closest thing I have found is the test command which can check if  
a file exists and is bigger than 0 bytes.

I don't suppose anyone knows how to check the file sizes and run on a  
certain condition do they?

Ta,

Rob




-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html