Bestimmte files per befehl loeschen

Jan-Benedict Glaw jbglaw at lug-owl.de
Tue Feb 13 12:32:48 CET 2001


On Tue, Feb 13, 2001 at 11:01:39AM +0100, J�rgen Mengeling wrote:
> Moin,
> 
> 13.02.2001 11:43:40, Jan-Benedict Glaw <jbglaw at lug-owl.de> wrote:
> 
> >Warum? find kennt etwas ganz n�tzliches: '-exec':
> >
> >	find . -type f ! -name '*.jpg' -a ! -name '.....' -exec rm -f {} \;
> >
> >...dann kann man sich die xags schenken.
> 
> hab ich besonders bei Dateien mit 'Spaces' drinnen lieb -).
> Dann braucht man xargs (und die Null terminierung von find)

H�? *kopfsch�ttel* Funktioniert doch:

jbglaw at linserver:~$ touch "datei mit spaces drin"
jbglaw at linserver:~$ find . -type f -name '*spaces*' -exec mv {} blahfaselfoo \;
jbglaw at linserver:~$ ls blah* datei*
ls: da*: No such file or directory
blahfaselfoo


'-exec' �bergibt die Dateinamen ordentlich, nicht �ber system()! Das
finktioniert einfach;)

MfG, JBG

-- 
Fehler eingestehen, Gr��e zeigen: Nehmt die Rechtschreibreform zur�ck!!!
/* Jan-Benedict Glaw <jbglaw at lug-owl.de> -- +49-177-5601720 */
keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB
     "insmod vi.o and there we go..." (Alexander Viro on linux-kernel)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20010213/7b270453/attachment.sig>


More information about the Linux mailing list