1.按文件类型判断

例子:
test -e /root/install.log

[-e /root/install.log]

2.按文件权限判断

3.两个文件之间判断