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

Re: Windows filename & dir renaming?



Brian wrote:

> What is an easy way to rename a lot of files and directories that were
> moved from Windows? They have (, spaces, ^, $, etc in them. `ls |sed
> s/\ //g` removes spaces, but then I don't how to take each one and
> move the file/dir correctly.

Quick and dirty:

for i in *; do echo mv \"$i\" `echo $i | sed "s/ /_/g"`; done | sh



Reply to: