Jump to content
xisto Community
saneax

Delete Files By Size Recursively

Recommended Posts

This is something I had always wated to do, but was afraid of the find's complexity.. here is a very short description, of how I did it.. My linux box.. running squid had no space.. then I relaized.. that squid had those millions of cache files.. deleting them one by one was real pain.. so had to read the 'man find' and here is the result.. it got back 70% of my space..find /var/spool/squid/* -size +10k -type f -exec rm -f '{}' \;The command meaning..find args1 = <where to find>args2 = <find by what, which means it could be -name, -type and here we give -size to mean we wish to find files by size>args3 = <what size.. +10k would mean above 10 kilo bytes>args4 = <and one more condition .. -type, which means what type of things should it match>args5 = <-f means files.. we could have mentioned -d (directory) -b (block), -c (character), -f (regular file), -l (link), -s (socket), -p (pipes) >args6 = <-exec means what action to perform if all the matches are true, so -exec is for action..>args7..10 = < the following of -exec is a shell command.. rm -f {} \; this means the results of match is removed (deleted)>Cheers...

Share this post


Link to post
Share on other sites

Dear All,After moving the .Xls file I want delete that file.Am trying this its moving .Xls file, but its not deleted.I develop this code in corejava. Outside my project its deleted but in my project its not deleted.Can you please tell me what is the reason? -sreelatha

Share this post


Link to post
Share on other sites

Dear All,
After moving the .Xls file I want delete that file.
Am trying this its moving .Xls file, but its not deleted.

I develop this code in corejava. Outside my project its deleted but in my project its not deleted.

Can you please tell me what is the reason?

-sreelatha

You should be more explicit. You answer to saneax's post, which trick works correctly provided that you are on a Unix or on a Linux system. The "rm" mentionned commands definitively removes the file, so it could lead to unwanted restults but that's another story.
Now, let's come to your problem, explain slightly more what you are doing. The "xls file" seems to be an indication that you are working on Excel files, probably with a MS-Windows system ? And what are you really trying to do ? Are you using a shell-script ? Could you show us the most pertinent lines in your scripts ?
Regards
Yordan

Share this post


Link to post
Share on other sites

For recover with excel files and possible more than files advise-corrupt Excel files not recognizable format,this tool helped me many times it is free as is known,utility save important information,such as graphics,statistic and mathematics,program will help you to recover valuable information and avoid its losses,tool scans your broken worksheet,then gets the data from this document,will help you to repair damaged files in Microsoft Excel sheet recognizable format,repair file Excel this file is not in a recognizable format, Excel showing this file does not in a recognizable format, or Microsoft Excel worksheet this file is not in a recognizeable format, it is an Excel file error: data may have been lost: Microsoft Excel impossible read file,tool performs a scan of your corrupt excel files not recognizable format and attempts to recover all available data.

Share this post


Link to post
Share on other sites
Batch removing multiple lines from beginning and ending of html files.Delete Files By Size Recursively

Hi, I would like to know if there is any software that will batch remove a specific number of lines from the beginning and end of multiple html files and then join these files together.

I am not a programmer or have much knowledge with programming language, writing scripts etc.

Any help would be greatly appreciated.

-reply by Amber

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.