Your example is a bit odd. *All* files have a size 0 or greater.
To find files that are greater or equal than 10k you can negate it, "not smaller than 10k"
This is more efficient than an or condition
I have a purge script. Based on the Input parameter, the script has to find and delete the files greater than or equal to the nkb. For now, I am using the or condition as you mentioned above.
I have a faint memory of find's size rounding methods being a bit strange on some systems. You might want to search these fora for the discussion of it.
Would stat give you a getter output to work with? It gives you the output in a customisable format. Using ls or the -ls flag on find can cause issues if the file has a group name with spaces, for example:-
It might not be neat, but if you use find to get a list of files based on whatever other criteria you have, you can then work through the list with some simple tests for file size, a bit like this:-
Of course, you could substitute an input file for the output of your find command.
If you are looking for files over a certain size, then another option might be to call stat from your find with xargs, perhaps:-
This will give you the files in size order, so once you have the first file that exceeds your limit, you can assume that all the others will too.
What is the full criteria of your search and what actions do you want to take? It would be useful to show us the output from uname -a too.
Hi,
The blow code does not yeild any output.
find . -name "*.jar" -o -name "*.ksh" -o -name "*.properties" -name "*.war" -o -name "*.ear" -o -name "*.sh" -o -name "*.cfg" -exec ls -l {} \;
I wish to print the filename filesize filedate in HP-UX.
Can anyone help ? (9 Replies)
Hi,
I have a file by redirecting some contents in unix shell.
Even when there is no content that is being redirected, the file size still shows greater than zero.
but even if there is no matching pattern the file APPRES has size greater than 0bytes.
awk -f AA.awk $logfile>APPRES... (3 Replies)
Hi All,
OS:AIX 64 bits using korn shell.
Requirement:
shell script to check file size greater than 50M and send mail alert.
Thanks for your time!
Regards, (3 Replies)
Hi All,
I ran code in test environment to find the files more than 1TB given below is a snippet from code:
FILE_SYSTEM=/home/arun
MAX_FILE_LIMIT=1099511627776
find $FILE_SYSTEM -type f -size +"$MAX_FILE_LIMIT"c -ls -xdev 2>/dev/null |
while read fname
do
echo "File larger than... (3 Replies)
HI,
Can any tell me how to filter the list of files greater than the size specified by user. The size should be provided by user as an input.
Regards
shiva (6 Replies)
hi all,
in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders...
please help me, how can i find the total size of these specific files in the server... (3 Replies)
hello,
i'm trying to figure out the size of a mysql database shelling into my server with putty / command line.
is there / are there any commands that will return the size of a database, in MB?
thanks. (4 Replies)
Can I find wether a particular file exist and size greater than zero in one line command.
similar to this
if &&
something in one if test .... e.g. if
1.) is it possible ? ... if yes how
2.) what would be the return type in case there is success or failure. I mean if both are... (4 Replies)
ok I want to know how to touch a file and find out that it is greater than 0 then if it is not I want to fail the job other wise I want to success amnd go on. Can anyone help.
Thanks
Shannon Kammer (1 Reply)