rename (rename series of files)

Renames files by changing part of the filename. Useful for changing several similar filenames at one time.

Format:    rename currentname newname files
Examples:  rename rep oldrep rep*
           rename doc projdoc *doc*

Changes the first string to the second string in all files that match the pattern. The first example changes files named rep1.doc, rep2.doc, rep3.doc, and so on to new names oldrep1.doc, oldrep2.doc, oldrep3.doc, and so forth. The second example renames all files with doc anywhere in their names to projdoc; for instance, newdoc1 becomes newprojdoc1, newdoc2 becomes newprojdoc2, and so on.

Get Spring Into Linux® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.