[SATLUG] how to cat a file with - in the name

Bruce Dubbs bruce.dubbs at gmail.com
Sat Jan 23 22:37:59 CST 2010

Henry Pugsley wrote:
> On Sat, Jan 23, 2010 at 6:56 PM, Don Davis <dondavis at reglue.org> wrote:
>> There is a file with a dash '-' at the beginning of the name how can I cat
>> it?
>> --
> cat -- -filename
> The double -- terminates options and tells cat that everything after
> that point is an argument.  This works for most commands .. like rm --
> -filename.

That is the most precise.  Another way is to use a wildcard:

   cat ?filname

Of course there are potential conflicts with a wildcard.

   -- Bruce

More information about the SATLUG mailing list