Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Move all other files out of the directory and delete the directory with "rm -r".
Markus
Edit: note that I didn't understand that the OP has an important file which got the wrong name by accident, I thought that the file was created by accident and only had to be removed. So this suggestion may be not very helpful.
If the file with "-" in its name would be a collection of your family photos from past 10 years, would you also do it?
I want to fix it and not just get rid of the problem....
This is how I take care of dashed files. The first creates a file, the second renames it.
The double dash will work with a fairly large portion of commands. Tar, rsync, mv, cp, etc. etc.
Good thing to know.
Well, I found this in the manpage of bash
Code:
-- A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as
filenames and arguments. An argument of - is equivalent to --.
which explains the issue. With -- you tell the shell that the - is not part of an option.
...What on earth were you thinking when you said that!?!?!?!?!?
Well, I thought the file was created by accident and had to be removed, I did not understand that it was an important file which by accident got the wrong name.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.