From owner-freebsd-questions@FreeBSD.ORG Wed Feb 4 14:35:53 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBAD41065675 for ; Wed, 4 Feb 2009 14:35:53 +0000 (UTC) (envelope-from marshc187@gmail.com) Received: from mail-ew0-f21.google.com (mail-ew0-f21.google.com [209.85.219.21]) by mx1.freebsd.org (Postfix) with ESMTP id 39FDD8FC32 for ; Wed, 4 Feb 2009 14:35:53 +0000 (UTC) (envelope-from marshc187@gmail.com) Received: by ewy14 with SMTP id 14so4183541ewy.19 for ; Wed, 04 Feb 2009 06:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Lg+Ef2ixNeHo70d5sQUjemBJvw+VI9IqNErp4LSBHu8=; b=FYJlOgKd/cGEjhJcCMg4IHmM6z10tociial4CHoiT8+4Acp9Gx/2cOaA2QWb8fg4rX isc5zndKm6v7PP5cMYE1Wi3jKR8MNPqjESWGKAgFkqXmrB5UJjOS/BYUlmdG88Fz5dSL eSqNV/EBEbZ9nHpEaVXKwppBQEm+Wi7s2JVCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=jqQEz1rfZzaMnuz5p9WZLRUEeIus/nyh4LTEOYldv1vug57/tbr5lBL/HYbhIZt0Af i0xVZWzlaApDAnaOdx4eM/2T2B8puZBDpfkPsB411ssoZloMfwQG+vmf+5wwbhGmpzTv oOitYnLy4yufh9FhNnnoqhkw3AN7TSsW069bc= MIME-Version: 1.0 Received: by 10.210.39.8 with SMTP id m8mr155761ebm.154.1233758152257; Wed, 04 Feb 2009 06:35:52 -0800 (PST) Date: Wed, 4 Feb 2009 15:35:52 +0100 Message-ID: <332f78510902040635k6675a9b6u434879b42c66a579@mail.gmail.com> From: t-u-t To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: shell commands - exclusion 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, 04 Feb 2009 14:35:54 -0000 hi, i don't know if this is a freak question, but i was looking around to see if this is possible, and what the convention would be. if i have say one (or even two) single file/directories among many others, and i want to perform any said function like cp, mv, rm, etc.. , to all other files except that one or two, is there a way to do that in a single command? e.g rm -r * {-except foo1 foo15} and if there is, could the same be applied to other similar batch (?) operations, like pkg_delete -f "*" { except firefox3 wine thunderbird } etc.. i'm a bit new to the shell (took me a while to figure out *ls* and *ls | more*), but i can't find anything from google cuz i don't know what this would be called in the first place. otherwise is it better to protect them with chflags or other trickery? thanks in advance