filename beginning with a hyphen!

Discuss Applications

filename beginning with a hyphen!

Postby Calum » Thu Dec 11, 2003 2:46 pm

help!
Code: Select all
calum@claudia:~$ ls     
-\ suicide\ is\ painless.mp3 
calum@claudia:~$ mv -\ suicide\ is\ painless.mp3 suicide\ is\ painless.mp3
mv: invalid option -- 
Try `mv --help' for more information.

how can i rename this stupid file?

thanks!
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Tux » Thu Dec 11, 2003 2:51 pm

Quotation Marks
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Void Main » Thu Dec 11, 2003 2:51 pm

Two options. Use "--" as your first parameter after "mv" and before your file names. Or just preface the filename with "./". e.g.:

$ mv -- -dashfile nodashfile
$ mv ./-dashfile nodashfile
$ mv /full/path/-dashfile /full/path/nodashfile
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Calum » Fri Dec 12, 2003 5:12 pm

thank you. is this -- thing common amongst tools such as mv, ls, cat et cetera?
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Fri Dec 12, 2003 5:52 pm

My guess is that it would be even though I only use it for "mv" and "rm". Adding a leading path will work for all of them of course.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron