parsed.org

Tips by tag: dashes

Deleting Troublesome Files by xinu on Dec 19, 2007 01:38 PM

You've entered a command with an option that didn't exist and somehow you now have a file that starts with a hyphen (i.e., -myfile). If you try to remove it, rm thinks that you're offering up the options m, y, f, i, l, and e. No good, but you can give this a try instead:

$ rm -- -myfile

The double-hyphen will disable option parsing and let you delete the file with no problem.

dashesoptionsrmshell
RSS