Summary

In this chapter, we have looked at working with directories. Specifically, the following topics were covered:

  • Working with filenames and pathnames

  • Switching directories

  • Listing files and directories

  • Creating directories

  • Copying and moving directories

  • Removing directories

We reviewed each of these topics because it is important to know how to perform these functions when writing shell scripts. As you go further into this book, you will begin to see that directory manipulations occur quite frequently in shell scripts.

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.