[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scripting question



Marc Shapiro <mshapiro_42@yahoo.com> writes:


[...]

> How can I rename all of the files ina directory with the new name
> being the old name stripped of its leftmost three characters.  

My favorite way to do this is with sed and xargs.  First have sed
print the current name, then use an regexp to change it to the new
name:

    ls | sed -e p -e 's/^...//' |xargs -n 2 mv

-----Scott.


Reply to: