Sponsored Content
Full Discussion: Check the size of files
Top Forums UNIX for Dummies Questions & Answers Check the size of files Post 302255875 by osramos on Friday 7th of November 2008 09:49:06 AM
Old 11-07-2008
Hi, thanks for you help.

Tell me another thing, the 23999 value i supose is the same as 12Mb?
How this values appears?

Sorry for my newbie questions?

Quote:
Originally Posted by zaxxon
Code:
FILES=`find . -type f -size +23999 -print`
if [[ -n "${FILES}" ]]; then
     echo "Hey, I found some files larger than 12 MB!" |\
     mail -s 'Files > 12 MB found!' you@domain.org
else
     echo "Nothing of interest found."
fi

exit 0

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check if 3 files have same size in directory

I need to determine if any three files have the same file size in a specified directly? I have got as far as listing the file sizes but where to go from here? ls -al |sort -n -r +4 | awq '{print $5}' Thanks in anticipation (5 Replies)
Discussion started by: oggle
5 Replies

2. UNIX for Dummies Questions & Answers

Check file size

I need a unix script that will check the size of multiple files in the same directory or from a text file. (6 Replies)
Discussion started by: alnita
6 Replies

3. UNIX for Dummies Questions & Answers

How to check directory size

how say I have directory how can I get the directory size in mega and if it less then 1 mega so byts Thanks (4 Replies)
Discussion started by: umen
4 Replies

4. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies

5. Shell Programming and Scripting

To check file size

Hi All, I am in small problem.. i have one script which transfers some big files to my ftp usign normal command like put .... my problem is how to check whether my file have been transferred successfully on ftp or not... i know only inside ftp we have option like 'size' command which... (2 Replies)
Discussion started by: Shahul
2 Replies

6. Shell Programming and Scripting

Check file size and remove files

Hi, Here we have a situation where we have to check the file size and if the file size is greater than 0 bytes then remove the files from the directory. 1)EdwTrxn 2)EdwPost 3)EdwTndr 4)EdwSls 5)EdwSlsRej 6)EdwTndrRej Files will be created in the directory in the following manner. ... (5 Replies)
Discussion started by: srivsn
5 Replies

7. Shell Programming and Scripting

Check the file size - help

I want to write a batch job (ksh) with the following requirement we have file feeds coming to our system from other team, if the file size is greater than expected then we dont need to process the file for the day and need to archive the file and send email notification to the manager saying... (5 Replies)
Discussion started by: sithara
5 Replies

8. SCO

check partitions size in MB

hi Howto check partitions size in MB on SCO 5.0.6? Using df command I can see just in blocks. (4 Replies)
Discussion started by: ccc
4 Replies

9. Shell Programming and Scripting

check the file size

if ; then cp /tmp/testfolder/*.* ~/new/logs/ else echo "No files today" exit fi The problem is this doen't work when there is more than 1 file. Please tell me how to take the latest file and check the size of the file in a directory (1 Reply)
Discussion started by: sandy1028
1 Replies

10. Shell Programming and Scripting

How to check total files size in hdfs directory?

Is there a way to calculate the total file size of HDFS file directory in GB or MB? I dont want to use du/df command. Without that is there a way HDFS Directory - /test/my_dir (1 Reply)
Discussion started by: rohit_shinez
1 Replies
IN_ARRAY(3)								 1							       IN_ARRAY(3)

in_array - Checks if a value exists in an array

SYNOPSIS
bool in_array FALSE (mixed $needle, array $haystack, [bool $strict]) DESCRIPTION
Searches $haystack for $needle using loose comparison unless $strict is set. PARAMETERS
o $needle - The searched value. Note If $needle is a string, the comparison is done in a case-sensitive manner. o $haystack - The array. o $strict - If the third parameter $strict is set to TRUE then the in_array(3) function will also check the types of the $needle in the $haystack. RETURN VALUES
Returns TRUE if $needle is found in the array, FALSE otherwise. EXAMPLES
Example #1 in_array(3) example <?php $os = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $os)) { echo "Got Irix"; } if (in_array("mac", $os)) { echo "Got mac"; } ?> The second condition fails because in_array(3) is case-sensitive, so the program above will display: Got Irix Example #2 in_array(3) with strict example <?php $a = array('1.10', 12.4, 1.13); if (in_array('12.4', $a, true)) { echo "'12.4' found with strict check "; } if (in_array(1.13, $a, true)) { echo "1.13 found with strict check "; } ?> The above example will output: 1.13 found with strict check Example #3 in_array(3) with an array as needle <?php $a = array(array('p', 'h'), array('p', 'r'), 'o'); if (in_array(array('p', 'h'), $a)) { echo "'ph' was found "; } if (in_array(array('f', 'i'), $a)) { echo "'fi' was found "; } if (in_array('o', $a)) { echo "'o' was found "; } ?> The above example will output: 'o' was found SEE ALSO
array_search(3), isset(3), array_key_exists(3). PHP Documentation Group IN_ARRAY(3)
All times are GMT -4. The time now is 08:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy