C++Guns – RoboBlog

14.12.2010

How do I remove files that start with a dash?

Filed under: Allgemein — Tags: — Thomas @ 19:12

Since the file name begins with a '-' it looks like an option to the command. You need to force it to not look like an option. Put a ./ in front of it. Or give it the full file name path. Or tell the command you are through with options by using the double dash to end all option processing. This is common to most traditional Unix commands.

rm ./-stuff
rm /full/path/-stuff
rm -- -stuff

And the same for other utilities too.

mv ./-stuff differentstuff
mv -- -stuff differentstuff

http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#How-do-I-remove-files-that-start-with-a-dash_003f

Erschien mir nützlich

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress