[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

I'm too stupid to use find, can someone help me out, please?



Hi everybody

I'd like to delete all symbolic links in a directory. I thought I'm
smart and use find for that instead of doing it manually. OK. The find
man page says (snipped):

 -type c
        File is of type c:
        l      symbolic link

So far so good.

jorg@localhost:/tmp/$ find . -type l

shows me all symbolic links. Great. Read further:

 -exec command ;
        Execute  command;  true if 0 status is returned.  All 	following
arguments to find are taken to be arguments to the
	command until an  argument  consisting of `;' is encountered.
	The string `{}' is replaced by the current file name being
	processed  everywhere it occurs in the arguments to the command,
	not just in arguments where it is alone, as in some versions of
	find.  Both  of  these constructions might need to be escaped
	(with a `\') or quoted to protect them from expansion by the
	shell.  The command  is  executed in the starting directory.

This is not so clear anymore. But I think I understand that

jorg@localhost:/tmp/$ find . -type l -exec rm {};

should do what I want. But I get an error message saying

find: Missing argument for "-exec".

Huh? Why? I then started quoting the {} and the ; with backslashes and '
but without success. So, please, what am I doing wrong?

Thanks,
joerg

-- 
Gib GATES keine Chance!

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Reply to: