UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 16.3 Reordering ls Listings Chapter 16
Where Did I Put That?
Next: 16.5 The Three UNIX File Times

16.4 List All Subdirectories with ls -R

By default, ls lists just one directory. If you name one or more directories on the command line, ls will list each one. The -R (uppercase R) option lists all subdirectories, recursively. That shows you the whole directory tree starting at the current directory (or the directories you name on the command line).

This list can get pretty long; you might want to pipe the output to a pager program like more (25.3). The ls -C option is a good idea, too, to list the output in columns. (When the ls output goes to a pipe, BSD versions of ls won't make output in columns automatically.)

- JP

Previous: 16.3 Reordering ls Listings UNIX Power ToolsNext: 16.5 The Three UNIX File Times
16.3 Reordering ls Listings Book Index16.5 The Three UNIX File Times

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System