1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
2 .TH TEST "1" "March 2007" "GNU coreutils 6.9" "User Commands"
4 test \- check file types and compare values
21 .\" Add any additional description here
23 Exit with the status determined by EXPRESSION.
26 display this help and exit
29 output version information and exit
31 An omitted EXPRESSION defaults to false. Otherwise,
32 EXPRESSION is true or false and sets exit status. It is one of:
40 EXPRESSION1 \fB\-a\fR EXPRESSION2
41 both EXPRESSION1 and EXPRESSION2 are true
43 EXPRESSION1 \fB\-o\fR EXPRESSION2
44 either EXPRESSION1 or EXPRESSION2 is true
47 the length of STRING is nonzero
50 equivalent to \fB\-n\fR STRING
53 the length of STRING is zero
59 the strings are not equal
61 INTEGER1 \fB\-eq\fR INTEGER2
62 INTEGER1 is equal to INTEGER2
64 INTEGER1 \fB\-ge\fR INTEGER2
65 INTEGER1 is greater than or equal to INTEGER2
67 INTEGER1 \fB\-gt\fR INTEGER2
68 INTEGER1 is greater than INTEGER2
70 INTEGER1 \fB\-le\fR INTEGER2
71 INTEGER1 is less than or equal to INTEGER2
73 INTEGER1 \fB\-lt\fR INTEGER2
74 INTEGER1 is less than INTEGER2
76 INTEGER1 \fB\-ne\fR INTEGER2
77 INTEGER1 is not equal to INTEGER2
79 FILE1 \fB\-ef\fR FILE2
80 FILE1 and FILE2 have the same device and inode numbers
82 FILE1 \fB\-nt\fR FILE2
83 FILE1 is newer (modification date) than FILE2
85 FILE1 \fB\-ot\fR FILE2
86 FILE1 is older than FILE2
89 FILE exists and is block special
92 FILE exists and is character special
95 FILE exists and is a directory
101 FILE exists and is a regular file
104 FILE exists and is set\-group\-ID
107 FILE exists and is owned by the effective group ID
110 FILE exists and is a symbolic link (same as \fB\-L\fR)
113 FILE exists and has its sticky bit set
116 FILE exists and is a symbolic link (same as \fB\-h\fR)
119 FILE exists and is owned by the effective user ID
122 FILE exists and is a named pipe
125 FILE exists and read permission is granted
128 FILE exists and has a size greater than zero
131 FILE exists and is a socket
134 file descriptor FD is opened on a terminal
137 FILE exists and its set\-user\-ID bit is set
140 FILE exists and write permission is granted
143 FILE exists and execute (or search) permission is granted
145 Except for \fB\-h\fR and \fB\-L\fR, all FILE\-related tests dereference symbolic links.
146 Beware that parentheses need to be escaped (e.g., by backslashes) for shells.
147 INTEGER may also be \fB\-l\fR STRING, which evaluates to the length of STRING.
149 NOTE: your shell may have its own version of test and/or [, which usually supersedes
150 the version described here. Please refer to your shell's documentation
151 for details about the options it supports.
153 Written by Kevin Braunsdorf and Matthew Bradburn.
155 Report bugs to <bug\-coreutils@gnu.org>.
157 Copyright \(co 2007 Free Software Foundation, Inc.
159 This is free software. You may redistribute copies of it under the terms of
160 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
161 There is NO WARRANTY, to the extent permitted by law.
163 The full documentation for
165 is maintained as a Texinfo manual. If the
169 programs are properly installed at your site, the command
173 should give you access to the complete manual.