[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.
- Human-readable file sorting, Lars Ingebrigtsen, 2016/02/19
- Re: Human-readable file sorting, John Wiegley, 2016/02/19
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/19
- Re: Human-readable file sorting, John Wiegley, 2016/02/19
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Marcin Borkowski, 2016/02/20
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Marcin Borkowski, 2016/02/20
- Re: Human-readable file sorting, Nikolaus Rath, 2016/02/22
- Re: Human-readable file sorting, Marcin Borkowski, 2016/02/22
- Re: Human-readable file sorting,
Yuri Khan <=
- Re: Human-readable file sorting, Andreas Schwab, 2016/02/23
- Re: Human-readable file sorting, Marcin Borkowski, 2016/02/24
- Re: Human-readable file sorting, John Wiegley, 2016/02/20
- Re: Human-readable file sorting, Lars Ingebrigtsen, 2016/02/20
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/20
- Re: Human-readable file sorting, martin rudalics, 2016/02/20
- Re: Human-readable file sorting, Eli Zaretskii, 2016/02/20
- Re: Human-readable file sorting, Michael Heerdegen, 2016/02/20
- RE: Human-readable file sorting, Drew Adams, 2016/02/20
- dired and ls (was: Human-readable file sorting), Lars Ingebrigtsen, 2016/02/20