Running Commands Recursively
We’ve already shown you that the find
utility is inherently recursive. That is, it will automatically search through the subdirectories of your specified search path without you having to tell it to. Most Linux commands aren’t that way, however. If you want them to work recursively, you’ll have to tell them to. For the most part, this is done with either the -R
switch or the -r
switch. (Some commands use –R
, and some use –r
. Something that you’ll eventually see for yourself is that there’s not a lot of consistency in how the different commands work with option switches.) Let’s see how it all works with a hands-on lab.
The examples in this section involve using the numeric method to set file and directory permissions. For anyone who’s not familiar with how to do that, I’ve provided a reference in the Further Reading section.