[techtalk] filename special characters

ktb x.y.f at home.com
Sun Jan 21 13:22:34 EST 2001

On Sun, Jan 21, 2001 at 09:35:55AM -0800, Dennis Wheeler wrote:
> Hello,
> After more than a year, I still consider my self new to Linux. But it always
> seems to be the little things that trip me up the most. For example, I've
> only learned recently how to remove filenames with leading dash characters,
> '-', in their names. Use a dot-slash in front of the name:
>   rm ./-filename
> But now I have a new problem. I have a group of files with square bracket
> characters, 'file[2].txt' in their names, and I can't figure out how to
> search and replace those characters, since the '[]' characters are being
> interpreted as special characters in the shell.
>   find . -name \*\[ -print
>   find . -regex .*\[.* -print
> I've tried various combinations of these without success. Any advice on how
> to get rid of these characters?

rm "file[2].txt"
will remove the offending file.

I'd really love ta wana help ya Flanders but... Homer Simpson

More information about the Techtalk mailing list