2009-05-05 87 views

回答

8

rm ./--remove-files

請注意,--不被shell解釋,並且通過擴展名,使用\轉義它將不起作用。

4

RM - --remove-文件

+1

備選:RM ./--remove-files – lothar 2009-05-05 02:32:55

+0

雙引號是不必要的。 – camh 2009-05-05 12:00:11

4
$ ls -lah -- --remove-files 
-rw-r--r-- 1 xistence xistence  0B May 4 19:29 --remove-files 
$ rm -- --remove-files 
$ ls -lah -- --remove-files 
ls: --remove-files: No such file or directory 

所以,你想要的是使用 - 作爲參數,以RM之一,這意味着它會停止處理的getopt的,任何事情都是從字面上看後:

rm -- --remove-files