双横线 -- 是什么作用

-- 来表示options的结尾,一旦传入了 -- ,那么就不能传 command options了,只能传positional arguments了

 

比如说你想grep 一个文件中的-v的字符串,通常-v在grep中是reverse的option,但是通过-- 你可以这样使用:

grep -- -v file

 

https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean

posted @ 2021-09-22 20:52  hh9515  阅读(157)  评论(0)    收藏  举报