星期三, 6月 25, 2008

rm a file begins with a dash

如果檔案開頭有dash 的話, 直接rm 會出現錯誤
這時候要在前面加個 ./
eg: rm ./-test
就可以了

---edit 21:09 06/25/08 --

rm -- -test
也可以 ( thanks to Mark Raddatz )

2 則留言:

Mark Raddatz 提到...

You can also use the two dash terminator, indicating no other commands are following.
e.g. rm -- -test

Freehaha 提到...

thanks for that, i just found out that they're both written in the manual. It's just me too lazy to look it up :p