Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

(zdog) Re: (2) how to rename all files in a dir

by zdog (Priest)
on Jul 07, 2002 at 15:49 UTC ( #179983=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: how to rename all files in a dir
in thread how to rename all files in a dir

In case there is no specified file extension like .txt, something like this can be done:

perl -e 'for (grep {-f} <*>) { rename $_, sprintf("%02d%s", ++$i, $_) }'

Zenon Zabinski | zdog | zdog@perlmonk.org

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://179983]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2020-04-01 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (18 votes). Check out past polls.

    Notices?