Remove first n character from bunch of file names with cut

Ridalgo picture Ridalgo · Feb 3, 2015 · Viewed 58.9k times · Source

I am using

ls | cut -c 5-

This does return a list of the file names in the format i want them, but doesn't actually perform the action. Please advise.

Answer

Aman picture Aman · Feb 3, 2015
rename -n 's/.{5}(.*)/$1/' *

The -n is for simulating; remove it to get the actual result.