文件存在输出yes,否则输出no。
shell终端执行:
[ -f hello.txt ] && echo yes || echo no
-f 文件名字
[ -f hello.txt ]
echo yes
||
echo no