📄 test.1
字号:
.TH TEST 1 .SH NAMEtest \- condition command.SH SYNOPSIS.B testexpr.SH DESCRIPTION.I testevaluates the expression.IR expr ,and if its value is true then returns zero exit status; otherwise, anon zero exit status is returned..I testreturns a non zero exit if there are no arguments..PPThe following primitives are used to construct.IR expr ..TP 9n.BR \-r " file"true if the file exists and is readable..TP .BR \-w " file"true if the file exists and is writable..TP .BR \-f " file"true if the file exists and is not a directory..TP .BR \-d " file"true if the file exists and is a directory..TP .BR \-s " file"true if the file exists and has a size greater than zero..TP .BR \-t " [ fildes ]"true if the open file whose file descriptor number is.I fildes(1 by default)is associated with a terminal device..TP .BR \-z " s1"true if the length of string.I s1is zero..TP .BR \-n " s1"true if the length of the string.I s1is nonzero..TP .RB s1 " = " s2trueif the strings.I s1and.I s2are equal..TP .RB s1 " != " s2trueif the strings.I s1and.I s2are not equal..TP s1true if.I s1is not the null string..TP .RB n1 " \-eq " n2true if the integers.I n1and.I n2are algebraically equal.Any of the comparisons.BR \-ne ,.BR \-gt ,.BR \-ge ,.BR \-lt ,or.BR \-lemay be used in place of.BR \-eq ..PPThese primaries may be combined with thefollowing operators:.TP .B !unary negation operator.TP .B \-abinary.I andoperator.TP .B \-obinary.I oroperator.TP .BR "( " "expr" " )"parentheses for grouping..PP.B \-ahas higher precedence than.B \-o.Notice that all the operators and flags are separatearguments to.IR test .Notice also that parentheses are meaningfulto the Shell and must be escaped..SH "SEE ALSO"sh(1), find(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -