此命令中标志 -s 的含义是什么?
What is the meaning of flag -s in this command?
我遇到了在.zshrc 中加载nvm 环境的命令,但我不知道它与flag -s 到底有什么关系。我知道方括号是检查此命令中的文件夹是否存在的条件。但是不知道 -s 是做什么的。
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
有人知道这个命令中的标志 -s 吗?提前致谢。
[
与 test
相同。检查 test
的联机帮助页:
-s file True if file exists and has a size greater than zero.
更新:实际上,使用 man '['
也可以。
我遇到了在.zshrc 中加载nvm 环境的命令,但我不知道它与flag -s 到底有什么关系。我知道方括号是检查此命令中的文件夹是否存在的条件。但是不知道 -s 是做什么的。
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
有人知道这个命令中的标志 -s 吗?提前致谢。
[
与 test
相同。检查 test
的联机帮助页:
-s file True if file exists and has a size greater than zero.
更新:实际上,使用 man '['
也可以。