Hour 4. Working with Directories

UNIX uses a hierarchical structure for organizing files and directories, which is referred to as a directory tree. The tree has a single root node, slash (/); all other directories are contained below it.

Every directory, including /, can store both files and other directories. Every file is stored in a directory, and every directory, except /, is stored within a directory.

This is slightly different from the multi-root hierarchical structure used by Windows and Mac OS. In those operating systems, all devices (floppy disk drives, CD-ROMs, hard drives, and so on) are located at the same top-most level. The UNIX model is slightly different, but after you've adjusted to it, it is extremely convenient.

This chapter ...

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.