Ubuntu Linux issue: Invalid option "-0"

buckjrdley

Member
Feb 28, 2011
35
0
0
I have a box at work running Ubuntu 10.04 and I have come across a very strange issue. I need to convert a large amount of raw format photos and I typically use:

dcraw -D *.CR2

I use this wildcard to convert the multitude of files in the canon raw format .CR2.
The issue is that only in the folder that the photos are located this command yields the error:

Invalid option "-0"

I have tested dcraw with the same parameters in a different folder and it works fine and other commands such as the build in mv command yield the same error when using a wildcard.

Why is this occurring?? Is it a permissions error?

I have copied the files to other folders to no avail.
 

buckjrdley

Member
Feb 28, 2011
35
0
0
Never mind I found the issue:

My coworker named some of the files with a minus character in front of the name " - "

So when the system walked through the files in the folder it saw the file name as an option:

-[myfilename]

Looks like I've got some renaming to do...
 

splat_ed

Member
Mar 12, 2010
189
0
0
First thought that springs to mind is to check the filenames... see if any have a " -0" in their name (note the space). If so, it could be treating those as part filename, part option

NVM: You found the issue at the same time as my post :p
 
Last edited:

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
A lot of commands will accept -- to mean anything after this is an option regardless of it's contents, so that might help. But naming things like that is bad anyway so you should probably rename them eventually.
 

buckjrdley

Member
Feb 28, 2011
35
0
0
Out of habit I always only use lowercase letters and underscores for naming files and directories, but it's a whole different ballgame when someone else names the files you need to use...
I'll have to go over some naming guidelines, because when you deal with so many files, it's not easy to catch mistakes.