Advertisement

06.04.2007 at 06:00AM PDT, ID: 22610843
[x]
Attachment Details

Check for specific file size in Unix If Statement

Asked by XOracle in HP-UX Unix, Unix Operating Systems

Tags: unix, size, file, check

Hello Experts.

I'm sure this is a simple one, but not within my small realm of knowledge.

How do check to see if a file is at least a certain size? I want to say:

If my_file.txt is greater than 256 Bytes then...

I currently have if  [ -s my_file.txt ] then

which I believe checks to see if there is any size, but I want to specifiy the size parameter.

Thank you for your help.Start Free Trial
[+][-]06.04.2007 at 06:45AM PDT, ID: 19208415

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: HP-UX Unix, Unix Operating Systems
Tags: unix, size, file, check
Sign Up Now!
Solution Provided By: nixfreak
Participating Experts: 4
Solution Grade: A
 
 
[+][-]06.04.2007 at 08:45AM PDT, ID: 19209472

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.04.2007 at 10:44AM PDT, ID: 19210458

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2007 at 10:54AM PDT, ID: 19210525

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2007 at 10:56AM PDT, ID: 19210547

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32