This may be a simple question, but how do I use files starting with "-" with command line programs?
For example, I am trying to use pdfgrep on a file named -2013-01-01.pdf but it complains that there are no options defined for 2, 0, 1, 3 and so on.
Changing the filename to something that does not start with "-" solves it, but this is not an option since the files aren't created by me. I simply want to check for a specific change I know is coming.
--does not work with all command-line programs. I had assumed from that comment by the OP thatpdfgrepis one of them that doesn't recognize--. But the accept here suggests otherwise. In any case, a program must be coded to recognize--. Many programs use libraries to parse their arguments, which do recognize--. But some don't, and of those, some are not coded to recognize--. – Eliah Kagan Apr 05 '13 at 00:10--the usual workaround is putting./in front of the file:pdfgrep ./-2013-01-01.pdf– Carlos Campderrós Apr 05 '13 at 06:51./in front is the most portable and robust solution. Works on any program, on any unix version. – hlovdal Apr 05 '13 at 07:38