cancel
Showing results for 
Search instead for 
Did you mean: 

Remove files

Former Member
0 Kudos

Hi experts,

I am trying to remove files in our unix box where there are nearly 10000 of files .

i am using the below command, but it says no match, or too many arguments etc.

rm -rf 200607?/* and rm -rf 200607/*.

Please help.

thanks

anuroop

Accepted Solutions (1)

Accepted Solutions (1)

markus_doehr2
Active Contributor
0 Kudos

You can do try to delete them one by one using a script like

find . -name 2006* | xargs rm -f 

Markus

Former Member
0 Kudos

Hi markus ,

Thanks for the reply. when i try to do as you have said ,

I get the message as " Arguments too long "

Can you please help me what can i do.

Thanks

anuroop

markus_doehr2
Active Contributor
0 Kudos

I get the message as " Arguments too long "

this is really strange.

What´s the output of

find . -name 2006* | head

Markus

Former Member
0 Kudos

Hi,

I still get the same message as Arguments too long.

In the directory called xyz, there are 10000 of files and this files are accrued monthly.I need to delete some of the monthly files .So for e.g

200607* year 2006 and month july, so i need to delete this month files,like that i need delete till september.

when i do

Host:<SID>adm 28> find . -name 200607* | head

Arguments too long.

In the same way when i do

Host:<SID>adm 28>find . -name 200607* | xargs rm -f

Arguments too long.

Thnaks

markus_doehr2
Active Contributor
0 Kudos

> Host:<SID>adm 28> find . -name 200607* | head

> Arguments too long.

What's the output of

uname -a

Markus

Former Member
0 Kudos

It is HP-UX Host B.11.23 U ia64.

Thanks

markus_doehr2
Active Contributor
0 Kudos

I'm not sure what the problem could be.

I have a directory here with > 200.000 files which doesn't show that problem.

Can you do

find . | head

Is this an NFS mounted directory or is this a local VxFS directory?

Markus

Former Member
0 Kudos

When i have done as you have said, i got the below

./200809121322150001436315

./20080912132216000038001434

./200809121322170001436315

./200809121322180001435709

It is a mounted directory.

thnaks

markus_doehr2
Active Contributor
0 Kudos

> When i have done as you have said, i got the below

> ./200809121322150001436315

> ./20080912132216000038001434

> ./200809121322170001436315

> ./200809121322180001435709

Ok - so your find command seems to work.

If you now do

find . -name 2006* | head

then comes the error message?

Markus

Former Member
0 Kudos

Hi,

This is what i get.

Hostname:<SID>adm 36> find . -name 2006* | head

Arguments too long.

Thanks

markus_doehr2
Active Contributor
0 Kudos

What shell do you use?

Markus

Former Member
0 Kudos

maybe a little change in syntax:

find . -name 2006\* | head

Former Member
0 Kudos

Please try this command, it will help you

find . -name 200607\* | xargs rm -f

Thanks

Answers (3)

Answers (3)

Former Member
0 Kudos

USe the below you should be successfull

find . -name 2006* | xargs rm -f

Former Member
0 Kudos

Hello Anuroop,

Could you please reply on following points

Provide us the few sample file name.

Are all the files are in same folder?

Is there any other files present in the directory?

Best wishes...

Sovon Sengupta

andreas_herzog
Active Contributor
0 Kudos

then you have to narrow the selection to a specific subset in order to get the deletion done...

GreetZ, AH