Dave's Brain

Browse - computer tips - linux remove file with name starting with dash

Date: 2011mar3
OS: Linux

Q.  How do I remove a file that has a name starting with a dash?

A.  Use the full path or add ./ in front.
To remove a file called "-junk" do this:

	rm ./-junk

Or

	rm /full/path/to/file/-junk

This works for renaming, touching and copying too.
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: