O'Reilly logo

Solaris™ Operating Environment Boot Camp by Dominic Butler, David Rhodes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Files and Directories

When files are created on a filesystem they are stored inside a directory. A directory is simply a file that has a particular format. It is stored on the disk in the same way as ordinary files. The only reason you can't edit them like an ordinary file is because the editor programs (such as vi) specifically stop you from doing so. We will use the directory /var/adm as an example to demonstrate the structure of a directory.

As you know, the ls command is provided to list the contents of a directory:

hydrogen# cd /var/adm
hydrogen# ls
aculog     log        passwd     sulog      utmpx      wtmp
lastlog    messages   spellhist  utmp       vold.log   wtmpx
hydrogen#

This has shown us the names of the files and directories that are in the directory /var/adm, but ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required