Tuesday, February 10, 2009

Linux - working with filenames and directories starting with a - (dash)

I use SVN daily on my Linux development server, but today I ran into a silly problem that took me some figuring out.

If you try to work with filenames that start with - (dash) such as "-filename.ext", you will get errors such as:
svn: invalid option character: i
Type 'svn help' for usage.


After some looking around, the solution for it was, instead of:
svn rm -filename.ext

To pass '--' as the first argument:
svn rm -- -filename.ext


Hope it helps anyone out there.

No comments: