[plug] Renaming files
Leon Brooks
leon at brooks.fdns.net
Sat Apr 6 20:33:17 WST 2002
On Friday 05 April 2002 08:07 pm, Paul Dean wrote:
> I would like to rename a large number of files by stipping of the first
> 35 chars.
> So if someone could point me in the right direction would be much
> appreciated.
for x in *; do mv -v "$x" "$(echo $x | cut -b 35-)"; done
The -v is optional, makes mv tell you what it's doing, the 35- says print
char 35 and on, if it doesn't work out at the right spot, change this.
Cheers; Leon
More information about the plug
mailing list