Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2006 11:06:39 -0400 (EDT)
From:      Ensel Sharon <user@dhp.com>
To:        freebsd-questions@freebsd.org
Subject:   deleting with wildcards over ssh ... how ?
Message-ID:  <Pine.LNX.4.21.0608301059480.31959-100000@shell.dhp.com>

next in thread | raw e-mail | index | archive | help

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@host rm -rf /some/testdir/*
ssh: No match.

Then, these combinations of single and double quotes:

ssh user@host 'rm -rf /some/testdir/*'

ssh user@host rm -rf '/some/testdir/*'

ssh user@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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0608301059480.31959-100000>