From owner-freebsd-questions@FreeBSD.ORG Tue May 18 10:25:35 2004 Return-Path: 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 3E1FD16A4CE for ; Tue, 18 May 2004 10:25:35 -0700 (PDT) Received: from mailgate-internal1.sri.com (mailgate-internal1.SRI.COM [128.18.84.103]) by mx1.FreeBSD.org (Postfix) with SMTP id 1B40943D1F for ; Tue, 18 May 2004 10:25:34 -0700 (PDT) (envelope-from hogsett@csl.sri.com) Received: (qmail 5692 invoked from network); 18 May 2004 17:25:33 -0000 Received: from localhost (HELO mailgate-internal1.SRI.COM) (127.0.0.1) by mailgate-internal1.sri.com with SMTP; 18 May 2004 17:25:33 -0000 Received: from quarter.csl.sri.com ([130.107.1.30]) M2004051810253314034 ; Tue, 18 May 2004 10:25:33 -0700 Received: from beast.csl.sri.com (beast.csl.sri.com [130.107.2.57]) by quarter.csl.sri.com (8.12.9/8.12.10) with ESMTP id i4IHPXG4003993; Tue, 18 May 2004 10:25:33 -0700 Received: from beast.csl.sri.com (localhost.localdomain [127.0.0.1]) by beast.csl.sri.com (8.12.10/8.12.10) with ESMTP id i4IHPXwR016752; Tue, 18 May 2004 10:25:33 -0700 Received: from beast.csl.sri.com (hogsett@localhost)i4IHPXtT016748; Tue, 18 May 2004 10:25:33 -0700 Message-Id: <200405181725.i4IHPXtT016748@beast.csl.sri.com> To: Drew Tomlinson In-Reply-To: Message from Drew Tomlinson of "Tue, 18 May 2004 10:21:37 PDT." <40AA4621.3000605@mykitchentable.net> User-Agent: SEMI/1.14.4 (Hosorogi) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Date: Tue, 18 May 2004 10:25:33 -0700 From: Mike Hogsett cc: FreeBSD Questions Subject: Re: How To Copy A Group of Files To Different Name? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 17:25:35 -0000 > How can I copy a group of files to a different name. I want to copy all > files starting with 'bacula*' to 'bacula*.old'. So I have these four files: > > blacklamb# ll bac* > -r--r--r-- 1 root wheel 949 Apr 22 09:13 bacula-barcodes > -rw-r----- 1 root wheel 5792 May 17 16:52 bacula-dir.conf > -rw-r----- 1 root wheel 763 Apr 22 09:13 bacula-fd.conf > -rw-r----- 1 root wheel 1909 May 17 16:31 bacula-sd.conf > > I want to have copies of these files with '.old' appended to their > names. I've tried 'cp -pv bac* bac*.old' but cp complains. Because > it's only 4 files, I'll do each one independently but I'd like to know > how to do this "right" for future reference. Well it may not be right, but there is more than one way to skin a cat. if using bash as your shell you could do > for b in * > do > mv $b ${b}.old > done