[Gllug] Finding filenames with special characters (was Mass renaming of files)

Simon Morris smorris at batesuk.com
Sun May 11 06:48:49 UTC 2003


GLLUGers,

Thanks for all your help with my problem of renaming filenames
containing colons.

The solution I used in the end was Rich Jones' --

find /psd1/server/proposals -name '*:*' | perl -e 'while(<>){chomp;print
"mv \"$_\" "; $_ =~ tr/:/-/; print "\"$_\"\n"}' | sh

It needs to be run recursively for filenames containing multiple colons,
and on that server with full 255GB drives takes ages but it saved the
day.

I've also come across some other problem filenames I need to find. 

How do you find filenames containing the following characters

* " | ?

There are also some directorys and files with no names! How am I
supposed to find them???

It would probably be better to stop the OS allowing daft filenames like
these. Is that possible?

Cheers
-- 
Simon Morris <smorris at batesuk.com>
Bates UK 



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list