From: Glynn Clements Subject: Re: renaming multiple files Date: Tue, 23 Nov 2004 01:30:40 +0000 Message-ID: <16802.37568.605213.224819@cerise.gclements.plus.com> References: <41A20C74.4050709@fcaglp.unlp.edu.ar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <41A20C74.4050709@fcaglp.unlp.edu.ar> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: zyserman@fcaglp.unlp.edu.ar Cc: linux-admin@vger.kernel.org Fabio Zyserman wrote: > I have some files in a directory, called > prefix-file1 > prefix-file2 > etc > > I want to rename them to > file1 > file2 > etc > > How can I do it with a bash command? for file in prefix-* ; do mv "$file" "${file##prefix-}" done Various utilities exist to perform this task, e.g. rename, mmv, but none are standard (rename is from util-linux, so it's likely to exist on most Linux systems, but not other Unices). -- Glynn Clements