Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Feb 2009 15:35:52 +0100
From:      t-u-t <marshc187@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   shell commands - exclusion
Message-ID:  <332f78510902040635k6675a9b6u434879b42c66a579@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?332f78510902040635k6675a9b6u434879b42c66a579>