Friday, June 1, 2012

Escaping File Names That Start with Dash "-" in Bash

Let's say there is a file name called "-abcd", "cd -abcd" won't work because the dash in front is interpreted as an option. The method I use to workaround this is to add "--" behind the "cd", to indicate the end of the options.

"cd -- -abcd"

No comments:

Post a Comment