Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8053406
  • 博文数量: 594
  • 博客积分: 13065
  • 博客等级: 上将
  • 技术积分: 10324
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-26 16:44
个人简介

推荐: blog.csdn.net/aquester https://github.com/eyjian https://www.cnblogs.com/aquester http://blog.chinaunix.net/uid/20682147.html

文章分类

全部博文(594)

分类:

2008-03-31 13:56:08

-b file            若文件存在且是一个块特殊文件,则为真
-c file           
若文件存在且是一个字符特殊文件,则为真
-d file           
若文件存在且是一个目录,则为真
-e file           
若文件存在,则为真
-f file           
若文件存在且是一个规则文件,则为真
-g file           
若文件存在且设置了SGID位的值,则为真
-h file           
若文件存在且为一个符合链接,则为真
-k file           
若文件存在且设置了"sticky"位的值
-p file           
若文件存在且为一已命名管道,则为真
-r file           
若文件存在且可读,则为真
-s file           
若文件存在且其大小大于零,则为真
-u file           
若文件存在且设置了SUID位,则为真
-w file           
若文件存在且可写,则为真
-x file           
若文件存在且可执行,则为真
-o file           
若文件存在且被有效用户ID所拥有,则为真

-z string          string长度为0,则为真
-n string         
string长度不为0,则为真
string1 = string2 
若两个字符串相等,则为真
string1 != string2
若两个字符串不相等,则为真

int1 -eq int2      int1等于int2,则为真
int1 -ne int2     
int1不等于int2,则为真
int1 -lt int2     
int1小于int2,则为真
int1 -le int2     
int1小于等于int2,则为真
int1 -gt int2     
int1大于int2,则为真
int1 -ge int2     
int1大于等于int2,则为真

!expr              expr为假则复合表达式为真。expr可以是任何有效的测试表达式
expr1 -a expr2    
expr1expr2都为真则整式为真
expr1 -o expr2    
expr1expr2有一个为真则整式为真

阅读(4092) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~