Hello John,

Here is one way:

ls | while read file ; do
  let inc++ ;
  mv ${file} Keyword$((${inc}-1))
done

Naturally, add some sanity checks (e.g. file does not already exist,
handle spaces).  You can also add wildcards or pipe into grep to
restrict the file list.

Good luck and let us know how things go.

Regards,
- Robert

On Wed, Feb 3, 2016 at 2:43 PM, John Jason Jordan <[email protected]> wrote:
> I frequently have a dozen or so screenshots taken with VLC. The files
> are in the format like this:
>
> vlcsnap-2016-02-03-14h28m24s290
>
> I wish to rename all the files in the folder that start with 'vlcsnap'
> to <some_keyword>#, where # is an incremental number starting with 0
> for the first one and incrementing for each one. The files appear in
> chronological order, and that is how I want them numbered. It is
> important that they be numbered in chronological order. But once they
> are renumbered I don't want the cumbersome time stamp on each file. In
> other words, using the above file as an example, and assuming that it
> is the first in the series, I want to rename it to to:
>
> Keyword0
>
> At this time I am renaming them individually one at a time. But I
> suspect that I can automate the process with the command line, saving
> myself a lot of tedious work. I could use some suggestions for how to
> go about this.
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to