Solaris file types

As you browse the directories in a Solaris UFS file system, you'll notice many file types. The file type can usually be identified by looking at the first character of the first column of information displayed when issuing the ls -l command.

A typical listing may look like this when listing the contents of the /etc directory

# ls -l /etc
ls -l /etc
total 583
lrwxrwxrwx   1 root     root          14 Aug  9 19:18 TIMEZONE -> ./default/init
drwxr-xr-x   6 root     other        512 Aug  9 20:51 X11
drwxr-xr-x   2 adm      adm          512 Aug 10 09:24 acct
lrwxrwxrwx   1 root     root          14 Aug  9 19:31 aliases -> ./mail/aliases
drwxr-xr-x   7 root     bin          512 Aug 10 09:34 apache
drwxr-xr-x   2 root     bin          512 Aug 10 09:26 apache2
drwxr-xr-x   2 root     other        512 Aug  9 20:29 apoc
-rw-r--r--   1 root     bin          226 Sep 13 14:17 auto_home
-rw-r--r--   1 root     bin          248 Aug  9 19:29 auto_master
lrwxrwxrwx   1 root     root          16 Aug  9 19:18 autopush -> ../sbin/autopush
drwxr-xr-x   2 root     other        512 Aug  9 20:19 bonobo-activation
drwxr-xr-x   2 root     sys          512 Aug  9 19:18 certs
lrwxrwxrwx   1 root     root          18 Aug  9 19:18 cfgadm -> ../usr/sbin/cfgadm
lrwxrwxrwx   1 root     root          18 Aug  9 20:18 chroot -> ../usr/sbin/chroot
   :
   :

The information displayed in the long listing is in the form of columns and is as follows (reading from left to right):

  1. Ten characters that describe the mode of the file. The first character displays the file type where:
    d The entry is a directory.
    D The entry is a door.
    l The entry is a symbolic link.
    b The entry is a block special file.
    c The entry is a character special file.
    p The entry is a FIFO (or "named pipe") special file.
    s The entry is an AF_UNIX address family socket.
    - The entry is an ordinary file.
  2. displays the number of links to the file
  3. displays the file's owner
  4. displays the file's group
  5. displays the file size in bytes
  6. date/time of the file's last modification
  7. filename (the -> after a file name denotes a symbolic link)