help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] how to bulk rename files


From: Eric Blake
Subject: Re: [Help-bash] how to bulk rename files
Date: Wed, 11 Apr 2012 14:51:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 04/11/2012 02:44 PM, address@hidden wrote:
> I have many files, 2.5 million, that I have to make available to Windows
> folks
> They demand that the files have a extension added
> Is there an efficient method of bulk renaming files

If you're wanting to use just bash features:

for f in $(generate your list of files); do
  mv "$f" "$f.ext"
done

If you want efficient, there's several purpose-built tools for this job,
but it is no longer a question for the bash list.  My favorite:

man mmv

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]