Chapter 7. Putting It All Together: ls

In this chapter

The V7 ls command nicely ties together everything we’ve seen so far. It uses almost all of the APIs we’ve covered, touching on many aspects of Unix programming: memory allocation, file metadata, dates and times, user names, directory reading, and sorting.

V7 ls Options

In comparison to modern versions of ls, the V7 ls accepted only a handful of options and the meaning of some of them is different for V7 than for current ls. The options are as follows:


Print all directory entries. Without this, don’t print ’.’ and ’..’. Interestingly enough, V7 ls ignores only ’.’ and ’..’, while V1 through V6 ignore any file ...

Get Linux® Programming by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.