J
J
jidckii2014-10-22 12:52:16
linux
jidckii, 2014-10-22 12:52:16

How to rename a group of files?

Good day to all.
Actually a subject.
I have an array of files that looks something like this:

66379 file PIR.pdf
66655 file PIR (2).pdf
66655 file PIR.pdf

It needs to be brought into view:
file 66379 PIR.pdf
file 66655 PIR (2).pdf
file 66655 PIR.pdf

Can you tell me the easiest way to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2014-10-22
@jidckii

rename 's/(\d+)\s+(.*?)\s+(PIR.*)/$2 $1 $3/' *.pdf

T
tag1970, 2014-10-22
@tag1970

bash sed awk?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question