OSDN Git Service

Update translations: chroot, csplit, dd, du, pwd
[linuxjm/coreutils.git] / original / man1 / test.1
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"
3 .SH NAME
4 test \- check file types and compare values
5 .SH SYNOPSIS
6 .B test
7 \fI\,EXPRESSION\/\fR
8 .br
9 .B test
10
11 .br
12 .B [
13 \fI\,EXPRESSION \/\fR]
14 .br
15 .B [
16 ]
17 .br
18 .B [
19 \fI\,OPTION\/\fR
20 .SH DESCRIPTION
21 .\" Add any additional description here
22 .PP
23 Exit with the status determined by EXPRESSION.
24 .TP
25 \fB\-\-help\fR
26 display this help and exit
27 .TP
28 \fB\-\-version\fR
29 output version information and exit
30 .PP
31 An omitted EXPRESSION defaults to false.  Otherwise,
32 EXPRESSION is true or false and sets exit status.  It is one of:
33 .TP
34 ( EXPRESSION )
35 EXPRESSION is true
36 .TP
37 ! EXPRESSION
38 EXPRESSION is false
39 .TP
40 EXPRESSION1 \fB\-a\fR EXPRESSION2
41 both EXPRESSION1 and EXPRESSION2 are true
42 .TP
43 EXPRESSION1 \fB\-o\fR EXPRESSION2
44 either EXPRESSION1 or EXPRESSION2 is true
45 .TP
46 \fB\-n\fR STRING
47 the length of STRING is nonzero
48 .TP
49 STRING
50 equivalent to \fB\-n\fR STRING
51 .TP
52 \fB\-z\fR STRING
53 the length of STRING is zero
54 .TP
55 STRING1 = STRING2
56 the strings are equal
57 .TP
58 STRING1 != STRING2
59 the strings are not equal
60 .TP
61 INTEGER1 \fB\-eq\fR INTEGER2
62 INTEGER1 is equal to INTEGER2
63 .TP
64 INTEGER1 \fB\-ge\fR INTEGER2
65 INTEGER1 is greater than or equal to INTEGER2
66 .TP
67 INTEGER1 \fB\-gt\fR INTEGER2
68 INTEGER1 is greater than INTEGER2
69 .TP
70 INTEGER1 \fB\-le\fR INTEGER2
71 INTEGER1 is less than or equal to INTEGER2
72 .TP
73 INTEGER1 \fB\-lt\fR INTEGER2
74 INTEGER1 is less than INTEGER2
75 .TP
76 INTEGER1 \fB\-ne\fR INTEGER2
77 INTEGER1 is not equal to INTEGER2
78 .TP
79 FILE1 \fB\-ef\fR FILE2
80 FILE1 and FILE2 have the same device and inode numbers
81 .TP
82 FILE1 \fB\-nt\fR FILE2
83 FILE1 is newer (modification date) than FILE2
84 .TP
85 FILE1 \fB\-ot\fR FILE2
86 FILE1 is older than FILE2
87 .TP
88 \fB\-b\fR FILE
89 FILE exists and is block special
90 .TP
91 \fB\-c\fR FILE
92 FILE exists and is character special
93 .TP
94 \fB\-d\fR FILE
95 FILE exists and is a directory
96 .TP
97 \fB\-e\fR FILE
98 FILE exists
99 .TP
100 \fB\-f\fR FILE
101 FILE exists and is a regular file
102 .TP
103 \fB\-g\fR FILE
104 FILE exists and is set\-group\-ID
105 .TP
106 \fB\-G\fR FILE
107 FILE exists and is owned by the effective group ID
108 .TP
109 \fB\-h\fR FILE
110 FILE exists and is a symbolic link (same as \fB\-L\fR)
111 .TP
112 \fB\-k\fR FILE
113 FILE exists and has its sticky bit set
114 .TP
115 \fB\-L\fR FILE
116 FILE exists and is a symbolic link (same as \fB\-h\fR)
117 .TP
118 \fB\-O\fR FILE
119 FILE exists and is owned by the effective user ID
120 .TP
121 \fB\-p\fR FILE
122 FILE exists and is a named pipe
123 .TP
124 \fB\-r\fR FILE
125 FILE exists and read permission is granted
126 .TP
127 \fB\-s\fR FILE
128 FILE exists and has a size greater than zero
129 .TP
130 \fB\-S\fR FILE
131 FILE exists and is a socket
132 .TP
133 \fB\-t\fR FD
134 file descriptor FD is opened on a terminal
135 .TP
136 \fB\-u\fR FILE
137 FILE exists and its set\-user\-ID bit is set
138 .TP
139 \fB\-w\fR FILE
140 FILE exists and write permission is granted
141 .TP
142 \fB\-x\fR FILE
143 FILE exists and execute (or search) permission is granted
144 .PP
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.
148 .PP
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.
151 .PP
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.
155 .SH AUTHOR
156 Written by Kevin Braunsdorf and Matthew Bradburn.
157 .SH "REPORTING BUGS"
158 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
159 .br
160 Report [ translation bugs to <http://translationproject.org/team/>
161 .SH COPYRIGHT
162 Copyright \(co 2016 Free Software Foundation, Inc.
163 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
164 .br
165 This is free software: you are free to change and redistribute it.
166 There is NO WARRANTY, to the extent permitted by law.
167 .SH "SEE ALSO"
168 Full documentation at: <http://www.gnu.org/software/coreutils/[>
169 .br
170 or available locally via: info \(aq(coreutils) test invocation\(aq