1df(1M) System Administration Commands df(1M)
2
3
4
6 df - displays number of free disk blocks and free files
7
9 /usr/bin/df [-F FSType] [-abeghklntVvZ]
10 [-o FSType-specific_options]
11 [block_device | directory | file | resource ...]
12
13
14 /usr/xpg4/bin/df [-F FSType] [-abeghklnPtVZ]
15 [-o FSType-specific_options]
16 [block_device | directory | file | resource ...]
17
18
20 The df utility displays the amount of disk space occupied by mounted or
21 unmounted file systems, the amount of used and available space, and how
22 much of the file system's total capacity has been used. The file system
23 is specified by device, or by referring to a file or directory on the
24 specified file system.
25
26
27 Used without operands or options, df reports on all mounted file sys‐
28 tems.
29
30
31 df may not be supported for all FSTypes.
32
33
34 If df is run on a networked mount point that the automounter has not
35 yet mounted, the file system size will be reported as zero. As soon as
36 the automounter mounts the file system, the sizes will be reported cor‐
37 rectly.
38
40 The following options are supported for both /usr/bin/df and
41 /usr/xpg4/bin/df:
42
43 -a
44
45 Reports on all file systems including ones whose entries in
46 /etc/mnttab (see mnttab(4)) have the ignore option set.
47
48
49 -b
50
51 Prints the total number of kilobytes free.
52
53
54 -e
55
56 Prints only the number of files free.
57
58
59 -F FSType
60
61 Specifies the FSType on which to operate. The -F option is intended
62 for use with unmounted file systems. The FSType should be specified
63 here or be determinable from /etc/vfstab (see vfstab(4)) by match‐
64 ing the directory, block_device, or resource with an entry in the
65 table, or by consulting /etc/default/fs. See default_fs(4).
66
67
68 -g
69
70 Prints the entire statvfs(2) structure. This option is used only
71 for mounted file systems. It can not be used with the -o option.
72 This option overrides the -b, -e, -k, -n, -P, and -t options.
73
74
75 -h
76
77 Like -k, except that sizes are in a more human readable format. The
78 output consists of one line of information for each specified file
79 system. This information includes the file system name, the total
80 space allocated in the file system, the amount of space allocated
81 to existing files, the total amount of space available for the cre‐
82 ation of new files by unprivileged users, and the percentage of
83 normally available space that is currently allocated to all files
84 on the file system. All sizes are scaled to a human readable for‐
85 mat, for example, 14K, 234M, 2.7G, or 3.0T. Scaling is done by
86 repetitively dividing by 1024.
87
88 This option overrides the -b, -e, -g, -k, -n, -t, and -V options.
89 This option only works on mounted filesystems and can not be used
90 together with -o option.
91
92
93 -k
94
95 Prints the allocation in kbytes. The output consists of one line of
96 information for each specified file system. This information
97 includes the file system name, the total space allocated in the
98 file system, the amount of space allocated to existing files, the
99 total amount of space available for the creation of new files by
100 unprivileged users, and the percentage of normally available space
101 that is currently allocated to all files on the file system. This
102 option overrides the -b, -e, -n, and -t options.
103
104
105 -l
106
107 Reports on local file systems only. This option is used only for
108 mounted file systems. It can not be used with the -o option.
109
110
111 -n
112
113 Prints only the FSType name. Invoked with no operands, this option
114 prints a list of mounted file system types. This option is used
115 only for mounted file systems. It can not be used with the -o
116 option.
117
118
119 -o FSType-specific_options
120
121 Specifies FSType-specific options. These options are comma-sepa‐
122 rated, with no intervening spaces. See the manual page for the
123 FSType-specific command for details.
124
125
126 -t
127
128 Prints full listings with totals. This option overrides the -b, -e,
129 and -n options.
130
131
132 -V
133
134 Echoes the complete set of file system specific command lines, but
135 does not execute them. The command line is generated by using the
136 options and operands provided by the user and adding to them infor‐
137 mation derived from /etc/mnttab, /etc/vfstab, or /etc/default/fs.
138 This option may be used to verify and validate the command line.
139
140
141 -Z
142
143 Displays mounts in all visible zones. By default, df only displays
144 mounts located within the current zone. This option has no effect
145 in a non-global zone.
146
147
148 /usr/bin/df
149 The following option is supported for /usr/bin/df only:
150
151 -v
152
153 Like -k, except that sizes are displayed in multiples of the small‐
154 est block size supported by each specified file system.
155
156 The output consists of one line of information for each file sys‐
157 tem. This one line of information includes the following:
158
159 o the file system's mount point
160
161 o the file system's name
162
163 o the total number of blocks allocated to the file system
164
165 o the number of blocks allocated to existing files
166
167 o the number of blocks available for the creation of new
168 files by unprivileged users
169
170 o the percentage of blocks in use by files
171
172
173 /usr/xpg4/bin/df
174 The following option is supported for /usr/xpg4/bin/df only:
175
176 -P
177
178 Same as -h except in 512-byte units.
179
180
182 The df utility interprets operands according to the following prece‐
183 dence: block_device, directory, file. The following operands are sup‐
184 ported:
185
186 block_device
187
188 Represents a block special device (for example, /dev/dsk/c1d0s7).
189
190
191 directory
192
193 Represents a valid directory name. df reports on the file system
194 that contains directory.
195
196
197 file
198
199 Represents a valid file name. df reports on the file system that
200 contains file.
201
202
203 resource
204
205 Represents an NFS resource name.
206
207
209 See largefile(5) for the description of the behavior of df when encoun‐
210 tering files greater than or equal to 2 Gbyte ( 2^31 bytes).
211
213 Example 1 Executing the df command
214
215
216 The following example shows the df command and its output:
217
218
219 example% /usr/bin/df
220
221 / (/dev/dsk/c0t0d0s0 ): 287530 blocks 92028 files
222 /system/contract (ctfs ): 0 blocks 2147483572 files
223 /system/object (objfs ): 0 blocks 2147483511 files
224 /usr (/dev/dsk/c0t0d0s6 ): 1020214 blocks 268550 files
225 /proc (/proc ): 0 blocks 878 files
226 /dev/fd (fd ): 0 blocks 0 files
227 /etc/mnttab (mnttab ): 0 blocks 0 files
228 /var/run (swap ): 396016 blocks 9375 files
229 /tmp (swap ): 396016 blocks 9375 files
230 /opt (/dev/dsk/c0t0d0s5 ): 381552 blocks 96649 files
231 /export/home (/dev/dsk/c0t0d0s7 ): 434364 blocks 108220 files
232
233
234
235
236 where the columns represent the mount point, device (or "filesystem",
237 according to df -k), free blocks, and free files, respectively. For
238 contract file systems, /system/contract is the mount point, ctfs is the
239 contract file system (used by SMF) with 0 free blocks and
240 2147483582(INTMAX-1) free files. For object file systems, /sys‐
241 tem/object is the mount point, objfs is the object file system (see
242 objfs(7FS)) with 0 free blocks and 2147483511 free files.
243
244 Example 2 Writing Portable Information About the /usr File System
245
246
247 The following example writes portable information about the /usr file
248 system:
249
250
251 example% /usr/xpg4/bin/df -P /usr
252
253
254
255 Example 3 Writing Portable Information About the /usr/src file System
256
257
258 Assuming that /usr/src is part of the /usr file system, the following
259 example writes portable information :
260
261
262 example% /usr/xpg4/bin/df -P /usr/src
263
264
265
266 Example 4 Using df to Display Inode Usage
267
268
269 The following example displays inode usage on all ufs file systems:
270
271
272 example%/usr/bin/df -F ufs -o i
273
274
275
277 SYSV3
278
279 This variable is used to override the default behavior of df and
280 provide compatibility with INTERACTIVE UNIX System and SCO UNIX
281 installation scripts. As the SYSV3 variable is provided for compat‐
282 ibility purposes only, it should not be used in new scripts.
283
284
285
286 When set, any header which normally displays "files" will now display
287 "nodes". See environ(5) for descriptions of the following environment
288 variables that affect the execution of df: LANG, LC_ALL, LC_CTYPE,
289 LC_MESSAGES, and NLSPATH.
290
292 The following exit values are returned:
293
294 0
295
296 Successful completion.
297
298
299 >0
300
301 An error occurred.
302
303
305 /dev/dsk/*
306
307 Disk devices
308
309
310 /etc/default/fs
311
312 Default local file system type. Default values can be set for the
313 following flags in /etc/default/fs. For example: LOCAL=ufs, where
314 LOCAL is the default partition for a command if no FSType is speci‐
315 fied.
316
317
318 /etc/mnttab
319
320 Mount table
321
322
323 /etc/vfstab
324
325 List of default parameters for each file system
326
327
329 See attributes(5) for descriptions of the following attributes:
330
331 /usr/bin/df
332 ┌─────────────────────────────┬─────────────────────────────┐
333 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
334 ├─────────────────────────────┼─────────────────────────────┤
335 │Availability │SUNWcsu │
336 └─────────────────────────────┴─────────────────────────────┘
337
338 /usr/xpg4/bin/df
339 ┌─────────────────────────────┬─────────────────────────────┐
340 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
341 ├─────────────────────────────┼─────────────────────────────┤
342 │Availability │SUNWxcu4 │
343 ├─────────────────────────────┼─────────────────────────────┤
344 │Interface Stability │Standard │
345 └─────────────────────────────┴─────────────────────────────┘
346
348 find(1), df_ufs(1M), mount(1M), statvfs(2), default_fs(4), mnttab(4),
349 vfstab(4), attributes(5), environ(5), largefile(5), standards(5),
350 objfs(7FS)
351
353 If UFS logging is enabled on a file system, the disk space used for the
354 log is reflected in the df report. The log is allocated from free
355 blocks on the file system, and it is sized approximately 1 Mbyte per 1
356 Gbyte of file system, up to 256 Mbytes. The log size may be larger (up
357 to a maximum of 512 Mbytes) depending on the number of cylinder groups
358 present in the file system.
359
360
361
362SunOS 5.11 26 Jul 2009 df(1M)