From owner-freebsd-questions Wed Jul 31 15: 1:59 2002 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 B8E0837B401 for ; Wed, 31 Jul 2002 15:01:56 -0700 (PDT) Received: from post.webmailer.de (natwar.webmailer.de [192.67.198.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AFBF43E31 for ; Wed, 31 Jul 2002 15:01:55 -0700 (PDT) (envelope-from barwick@gmx.net) Received: from ianb.local (pD9EB0948.dip.t-dialin.net [217.235.9.72]) by post.webmailer.de (8.9.3/8.8.7) with ESMTP id AAA16999; Thu, 1 Aug 2002 00:01:19 +0200 (MEST) Content-Type: text/plain; charset="iso-8859-1" From: Ian Barwick To: Maciej Szewczyk , questions@freebsd.org Subject: Re: files to files with .txt Date: Thu, 1 Aug 2002 00:02:51 +0200 X-Mailer: KMail [version 1.4] References: <20020731230256.A19666@pirx.9lo.lublin.pl> In-Reply-To: <20020731230256.A19666@pirx.9lo.lublin.pl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208010002.51591.barwick@gmx.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday 31 July 2002 23:02, Maciej Szewczyk wrote: > Hi, > I have about 1000 files. > ls -1 > 1 > 2 > 3 (...) > ... > ... > 998 > 999 > 1000 > And now I must have 1000 files with .txt -> > ls -1 > 1.txt > 2.txt > 3.txt > ... > ... > 998.txt > 999.txt > 1000.txt > Something along the lines of: find -E . -regex './[0-9]+' -exec mv {} {}.txt \; You'll want to be sure that 'find' finds the right files to rename. HTH Ian Barwick barwick@gmx.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message