www.delorie.com/gnu/docs/tar/tar_96.html   search  
 
Buy GNU books!


GNU tar

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7 Descending into Directories

(This message will disappear, once this node revised.)

@quote-arg

@quote-arg

Usually, tar will recursively explore all directories (either those given on the command line or through the --files-from=file-of-names (-T file-of-names) option) for the various files they contain. However, you may not always want tar to act this way.

The --no-recursion option inhibits tar's recursive descent into specified directories. If you specify `--no-recursion', you can use the find utility for hunting through levels of directories to construct a list of file names which you could then pass to tar. find allows you to be more selective when choosing which files to archive; see 6.3 Reading Names from a File for more information on using find with tar, or look.

--no-recursion
Prevents tar from recursively descending directories.

When you use `--no-recursion', GNU tar grabs directory entries themselves, but does not descend on them recursively. Many people use find for locating files they want to back up, and since tar usually recursively descends on directories, they have to use the `! -d' option to find @quote-arg {needs more explanation or a cite to another info file} as they usually do not want all the files in a directory. They then use the option to archive the files located via find.

The problem when restoring files archived in this manner is that the directories themselves are not in the archive; so the --same-permissions (--preserve-permissions, -p) option does not affect them--while users might really like it to. Specifying --no-recursion is a way to tell tar to grab only the directory entries given to it, adding no new files on its own.

@quote-arg


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)