From owner-freebsd-questions@FreeBSD.ORG Wed Aug 30 15:06:52 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4078416A4DA for ; Wed, 30 Aug 2006 15:06:52 +0000 (UTC) (envelope-from user@dhp.com) Received: from shell.dhp.com (shell.dhp.com [199.245.105.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38E8F43D5F for ; Wed, 30 Aug 2006 15:06:48 +0000 (GMT) (envelope-from user@dhp.com) Received: by shell.dhp.com (Postfix, from userid 896) id B2A1B312F9; Wed, 30 Aug 2006 11:06:39 -0400 (EDT) Date: Wed, 30 Aug 2006 11:06:39 -0400 (EDT) From: Ensel Sharon To: freebsd-questions@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: deleting with wildcards over ssh ... how ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 15:06:52 -0000 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.