emacs-devel
[Top][All Lists]
Advanced

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

Re: Human-readable file sorting


From: Yuri Khan
Subject: Re: Human-readable file sorting
Date: Tue, 23 Feb 2016 12:13:20 +0600

On Tue, Feb 23, 2016 at 3:31 AM, Marcin Borkowski <address@hidden> wrote:

>> $ mmv 'prefix*.jpg' 'prefix0#1.jpg'
>
> What about thumbnails?  Metadata kept in seperate files by image viewing
> programs?

Those are caches and should be invalidated by the rename.


> That wasn't too painful, but it was too simple. (Still, thanks for
> teaching me that mmv command - nice!)

Perl comes with a handy script rename(1) which performs multi-file
renames by applying a Perl regexp substitution, optionally filtering
by wildcard:

$ rename 's/^prefix(.*?)\.jpg$/prefix0$1.jpg/'


The util-linux package contains another utility, also named rename(1).
Its man page explicitly gives this use case as an example:

       Given the files foo1, ..., foo9, foo10, ..., foo278, the commands

              rename foo foo0 foo?
              rename foo foo0 foo??

       will turn them into foo001, ..., foo009, foo010, ..., foo278.



reply via email to

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