Re: How to use multiple command with in Find command?
- From: Bodo <bodo@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 11 May 2010 16:20:30 +0200
In article
<8e7ee693-e8e4-45b5-be35-df45a919f812@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
srikanth <srikanth007m@xxxxxxxxx> wrote:
Hi all,
I have a problem while executing multiple command with in Find
command. Actually my requirement is to find a file in a specific
directory and remove it and want to create a file with same name which
I have searched for. Here is what I am doing
find Desktop/Test -name test -exec rm -rf {} \; -exec touch {}/test \;
From the above command first command is executing successfully. But
when comes to touch command it was not creating file. Am i missing
some thing here. Can any one please help me. Also please suggest me if
there are any easy way to do it.
Thanks,
Srikanth.
Hi Srikanth,
maybe all you want is to erase the contents of the file with a single
command.
In this case a command like 'cp /dev/null > {}\;' is what might work.
Maybe you have to use /dev/zero
kind regards,
Bodo
.
- Follow-Ups:
- Re: How to use multiple command with in Find command?
- From: Barry Margolin
- Re: How to use multiple command with in Find command?
- Prev by Date: CELEBRITY TWINS
- Next by Date: TV INTERNET
- Previous by thread: CELEBRITY TWINS
- Next by thread: Re: How to use multiple command with in Find command?
- Index(es):
Relevant Pages
|