JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information

Preface

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

12.  SPARC: Adding a Disk (Tasks)

13.  x86: Adding a Disk (Tasks)

14.  Configuring iSCSI Storage Devices With COMSTAR

15.  Configuring and Managing the Solaris Internet Storage Name Service (iSNS)

16.  Managing Disk Use (Tasks)

Managing Disk Use (Task Map)

Displaying Information About Files and Disk Space

How to Display Information About Files and Disk Space

Checking the Size of Files

How to Display the Size of Files

How to Find Large Files

How to Find Files That Exceed a Specified Size Limit

Checking the Size of Directories

How to Display the Size of Directories, Subdirectories, and Files

How to Display the User Ownership of Local UFS File Systems

Finding and Removing Old or Inactive Files

How to List the Newest Files

How to Find and Remove Old or Inactive Files

How to Clear Out Temporary Directories

How to Find and Delete core Files

How to Delete Crash Dump Files

17.  The format Utility (Reference)

18.  Managing File Systems (Overview)

19.  Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)

20.  Mounting and Unmounting File Systems (Tasks)

21.  Configuring Additional Swap Space (Tasks)

22.  Copying Files and File Systems (Tasks)

23.  Managing Tape Drives (Tasks)

Index

Displaying Information About Files and Disk Space

This table summarizes the commands available for displaying information about file size and disk space.

Command
Description
Man Page
df
Reports the number of free disk blocks and files
du
Summarizes disk space allocated to each subdirectory
find -size
Searches recursively through a directory based on the size specified with the -size option
ls -lh
Lists the size of a file in the power of 1024 scaling

How to Display Information About Files and Disk Space

Example 16-1 Displaying Information About File Size and Disk Space

In the following example, all the file systems listed are locally mounted except for /usr/dist.

$ df
/                  (/dev/dsk/c0t0d0s0 ):  101294 blocks   105480 files
/devices           (/devices          ):       0 blocks        0 files
/system/contract   (ctfs              ):       0 blocks 2147483578 files
/proc              (proc              ):       0 blocks     1871 files
/etc/mnttab        (mnttab            ):       0 blocks        0 files
/etc/svc/volatile  (swap              ):  992704 blocks    16964 files
/system/object     (objfs             ):       0 blocks 2147483530 files
/usr               (/dev/dsk/c0t0d0s6 ):  503774 blocks   299189 files
/dev/fd            (fd                ):       0 blocks        0 files
/var/run           (swap              ):  992704 blocks    16964 files
/tmp               (swap              ):  992704 blocks    16964 files
/opt               (/dev/dsk/c0t0d0s5 ):   23914 blocks     6947 files
/export/home       (/dev/dsk/c0t0d0s7 ):   16810 blocks     7160 files

Example 16-2 Displaying File Size Information in 1024 Bytes on a System With a UFS Root File System

In the following example, file system information for a system with a UFS root file system is displayed in 1024 bytes.

$ df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0      249M   200M    25M    90%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   485M   376K   485M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
/dev/dsk/c0t0d0s6      3.2G   2.9G   214M    94%    /usr
fd                       0K     0K     0K     0%    /dev/fd
swap                   485M    40K   485M     1%    /var/run
swap                   485M    40K   485M     1%    /tmp
/dev/dsk/c0t0d0s5       13M   1.7M    10M    15%    /opt
/dev/dsk/c0t0d0s7      9.2M   1.0M   7.3M    13%    /export/home

Although /proc and /tmp are local file systems, they are not UFS file systems. /proc is a PROCFS file system, /var/run and /tmp are TMPFS file systems, and /etc/mnttab is an MNTFS file system.

Example 16-3 Displaying File Size Information in 1024 Bytes on a System With a ZFS Root File System

In the following example, file system information for a system with a Oracle Solaris ZFS root file system is displayed in 1024 bytes.

Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/s1008be      67G   4.6G    58G     8%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   1.9G   1.5M   1.9G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
                        63G   4.6G    58G     8% /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                        63G   4.6G    58G     8% /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
rpool/ROOT/s1008be/var
                        67G    73M    58G     1%    /var
swap                   1.9G    32K   1.9G     1%    /tmp
swap                   1.9G    40K   1.9G     1%    /var/run
rpool/export            67G    20K    58G     1%    /export
rpool/export/home       67G    18K    58G     1%    /export/home

Example 16-4 Displaying Total Number of Blocks and Files Allocated for a File System

The following example shows a list of all mounted file systems, device names, total 512-byte blocks used, and the number of files. The second line of each two-line entry displays the total number of blocks and files that are allocated for the file system.

$ df -t
/                  (/dev/dsk/c0t0d0s0 ):   101294 blocks   105480 files
                                  total:   509932 blocks   129024 files
/devices           (/devices          ):        0 blocks        0 files
                                  total:        0 blocks      113 files
/system/contract   (ctfs              ):        0 blocks 2147483578 files
                                  total:        0 blocks       69 files
/proc              (proc              ):        0 blocks     1871 files
                                  total:        0 blocks     1916 files
/etc/mnttab        (mnttab            ):        0 blocks        0 files
                                  total:        0 blocks        1 files
/etc/svc/volatile  (swap              ):   992608 blocks    16964 files
                                  total:   993360 blocks    17025 files
/system/object     (objfs             ):        0 blocks 2147483530 files
                                  total:        0 blocks      117 files
/usr               (/dev/dsk/c0t0d0s6 ):   503774 blocks   299189 files
                                  total:  6650604 blocks   420480 files
/dev/fd            (fd                ):        0 blocks        0 files
                                  total:        0 blocks       31 files
/var/run           (swap              ):   992608 blocks    16964 files
                                  total:   992688 blocks    17025 files
/tmp               (swap              ):   992608 blocks    16964 files
                                  total:   992688 blocks    17025 files
/opt               (/dev/dsk/c0t0d0s5 ):    23914 blocks     6947 files
                                  total:    27404 blocks     7168 files
/export/home       (/dev/dsk/c0t0d0s7 ):    16810 blocks     7160 files
                                  total:    18900 blocks     7168 files