Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] How to cope with strange filenames in bash?



On 03/07/07, Michal Hajek <hajek1@example.com> wrote:

a simple question:

deserves a simple answer. ;)

how do I cope in bash with filenames containing "-" character (i.e.
dash) ?

ls -- <fn>

In my case, I have downloaded this file:
-umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar

What is so special about it? This:

$ ls *.rar
ls: invalid option -- -
Try `ls --help' for more information.
$

Try this:

ls -- *.rar

Did it work?

"--" means "no more options, treat everything else as a literal" to
almost every Unix program.

Just for fun, "-" means "don't read from or write to a file, use
standard in or standard out instead".

Try this:

wget -O - http://www.jmglov.net/

See what I mean?

--
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links