You are not logged in.

#1 2005-09-02 23:54:50

punkandacoke
Member
Registered: 2004-03-09
Posts: 10

removing all .ini files from a directory structure [solved]

I moved all of my music files over from my windows partition and windows media player left a bunch of .ini files, so how would I delete all of them with one command.

find /root/music -name *.ini

That finds all the files that need to be deleted but I can't figure out the rm command that I would run afterwards.

Offline

#2 2005-09-03 00:53:43

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: removing all .ini files from a directory structure [solved]

rm -f `find /root/music -name *.ini`

Offline

#3 2005-09-03 00:58:23

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: removing all .ini files from a directory structure [solved]

naaaaaaah!

find /root/music -name *.ini -exec rm {} ;

-exec will run the command straight away

find /root/music -name *.ini -ok rm {} ;

-ok you have to use y/n confirmation

in both cases {} is the filename passed along

Offline

#4 2005-09-03 01:17:06

punkandacoke
Member
Registered: 2004-03-09
Posts: 10

Re: removing all .ini files from a directory structure [solved]

thanks alot guys

Offline

Board footer

Powered by FluxBB