1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
2 .TH TEST "1" "January 2016" "GNU coreutils 8.25" "User Commands"
4 test \- check file types and compare values
13 \fI\,EXPRESSION \/\fR]
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: [ honors the \fB\-\-help\fR and \fB\-\-version\fR options, but test does not.
150 test treats each of those as it treats any other nonempty STRING.
152 NOTE: your shell may have its own version of test and/or [, which usually supersedes
153 the version described here. Please refer to your shell's documentation
154 for details about the options it supports.
156 Written by Kevin Braunsdorf and Matthew Bradburn.
158 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
160 Report [ translation bugs to <http://translationproject.org/team/>
162 Copyright \(co 2016 Free Software Foundation, Inc.
163 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
165 This is free software: you are free to change and redistribute it.
166 There is NO WARRANTY, to the extent permitted by law.
168 Full documentation at: <http://www.gnu.org/software/coreutils/[>
170 or available locally via: info \(aq(coreutils) test invocation\(aq