
None of those directories need to exist ahead of time. The -p (parent) option tells the mkdir command to create any of the directories that don't exist - whatever is required to end up with the directory specified. While not strictly recursion, the mkdir command does something similar when it allows you to create a deep directory structure with a single command.
#PEAZIP COMMAND LINE RECURSIVE ZIP FILE#
A command like this one will create a zip file of all the files in the bin directory. The zip command offers an easy option for recursively pulling files into a zip file -r. Want to change ownership of all files within a particular directory (and below), just use chown -R. The chown command uses the -R option to recurse. But unless you want to see a lot of complaints, such as "bin is a directory", you're better off limiting what it tells you by adding the -s (suppress error messages) option. The grep command is another command that needs to be told if you want it to recurse. Add the command you want to run with syntax like "-exec chmod a-x \ The find command also provides a lot of other opportunities to make recursive changes with its -exec option. When set to 2, it will look into subdirectories, as well, but it will not look any further. When set to 1, maxdepth will mean that the find command will only look in the current directory. If you want the find command not to recurse at all or if you want to limit how deeply it delves into subdirectories, you have to impose limitations with the -maxdepth setting. You give it a starting point where you want to search, and it traverses into every directory that it can starting at that point. The find command doesn't need to be cajoled into recursing.


Commands like this will clean out directories that are no longer needed, but they will not follow symbolic links (only remove them). One of the more heavily used recursive options is the -r command that is used with the rm command, allowing directories and their contents to be removed in a single command. The recursive option with the cp command allows you to easily duplicate a directory.

Src share sbin man lib include games etc bin Bin etc games include lib man sbin share src
