deleting with wildcards over ssh ... how ?

John Webster jwebster at es.net
Wed Aug 30 15:23:40 UTC 2006


--On Wednesday, August 30, 2006 11:06:39 -0400 Ensel Sharon <user at dhp.com> wrote:

> 
> I want to delete some remote files with a wildcard, running 'rm' over ssh.
> 
> The obvious syntax doesn't work at all - it doesn't even make an ssh
> connection - I think it is interpreting the wildcard locally:
> 
># ssh user at host rm -rf /some/testdir/*
> ssh: No match.
> 
> Then, these combinations of single and double quotes:
> 
> ssh user at host 'rm -rf /some/testdir/*'
> 
> ssh user at host rm -rf '/some/testdir/*'
> 
> ssh user at host 'rm -rf "/some/testdir/*"'
> 
> All connect over ssh, and produce no errors, but the remote files are
> still there - nothing was deleted.
> 
> So what is the _right_ way to do this ?
> 
> Thanks.
> 


How about:

ssh user at host rm -rf /some/testdir/\* 




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20060830/fe656ca8/attachment.pgp


More information about the freebsd-questions mailing list