Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

While looking around one of the servers at work I noticed that the application account I was logged into had an odd file in its home directory. The file was named "-rw-r-----.". This was obviously something that went wrong and I decided to remove it. However when doing the naive thing and simply running the following command results in an error...
$ rm "-rw-r-----."
rm: invalid option -- 'w'
Try `rm ./-rw-r-----.' to remove the file `-rw-r-----.'.
Try `rm --help' for more information.


The issue arises because the file name starts with a dash character. The correct (and error free) way to remove such files is to use the -- command line argument with rm first like so...
$ rm -- -rw-r-----.


No errors!


Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...