Mailing List Archive


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

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



Hello, 

a simple question: 

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

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.
$

$ mv \-umai\-Doremi\-\-Kenichi\-10\-\-B36CAB67\-.avi.part1.rar k1.rar
mv: invalid option -- m
Try `mv --help' for more information.
$

$ mv "-umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar" k1.rar
mv: invalid option -- m
Try `mv --help' for more information.
$

$ mv '-umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar' k1.rar
mv: invalid option -- m
Try `mv --help' for more information.
$

$ mv `-umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar` k1.rar
bash: -umai-Doremi--Kenichi-10--B36CAB67-.avi.part1.rar: command not
found
mv: missing destination file operand after `k1.rar'
Try `mv --help' for more information.
$

Can someone more experienced please explain this behaviour to me? 

Best regards
Michal


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links