[plug] Renaming files

Steve Grasso steveg at calm.wa.gov.au
Mon Apr 8 16:17:24 WST 2002


It's actually cut -b 36- since the count begins at 0

Regards,
Steve

On Sat, 6 Apr 2002 20:33, Leon Brooks wrote:
> 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