From owner-freebsd-questions@FreeBSD.ORG Fri Feb 4 08:28:12 2005 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 BB68716A4CE for ; Fri, 4 Feb 2005 08:28:12 +0000 (GMT) Received: from orthanc.st.hmc.edu (orthanc.ST.HMC.Edu [134.173.56.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83B7D43D1F for ; Fri, 4 Feb 2005 08:28:10 +0000 (GMT) (envelope-from mac@orthanc.st.hmc.edu) Received: by orthanc.st.hmc.edu (Postfix, from userid 1001) id E07DA6165; Fri, 4 Feb 2005 00:28:14 -0800 (PST) Date: Fri, 4 Feb 2005 00:28:14 -0800 From: Mac Mason To: freebsd-questions@freebsd.org Message-ID: <20050204082813.GA4160@orthanc.st.hmc.edu> Mail-Followup-To: freebsd-questions@freebsd.org References: <20050204082350.17779.qmail@web51610.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: <20050204082350.17779.qmail@web51610.mail.yahoo.com> User-Agent: Mutt/1.4.2.1i Subject: Re: How will I rename every file in a directory to their filenames appending anything? 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: Fri, 04 Feb 2005 08:28:12 -0000 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Best handled with a shell loop, offhand: % for file in *.mp3 ; do mv $file $file.old ; done Modifying to suit your tastes. --Mac On Fri, Feb 04, 2005 at 12:23:50AM -0800, Mark Jayson Alvarez wrote: > Example. > I would want to rename every file that ends in .mp3 to > their filename with appended .old. >=20 > so that, test.mp3 will be renamed test.mp3.old? > my initial command would then be: >=20 > ls |grep mp3 |xargs -J # mv #..[this part is what > trying to figure out] >=20 > How will I tell the mv that its arguments would be the > output of ls and append something like ".old" to it? > ~ >=20 >=20 > Thanks! >=20 >=20 >=20 > =09 > =09 > __________________________________=20 > Do you Yahoo!?=20 > Yahoo! Mail - You care about security. So do we.=20 > http://promotions.yahoo.com/new_mail > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >=20 --=20 Julian "Mac" Mason mac@cs.hmc.edu Computer Science '06 (909)-607-3129 Harvey Mudd College =20 --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCAzId1AphoTGXiN0RArYeAJ9YvZhLkqyy4iEfv0AynG1LJySkBgCgjU2r zT/kxaeNWaWTpahteu4OW2k= =logQ -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v--