3

No, it's not a mistake, I mean dar, not tar. It seems to be a not-so-popular archiving tool (and file format). However, I need to extract a single directory from a 4GiB .dar-file.

In the man-page, dar lists a whole bunch of options of which I've tried -I (--include <mask>). However, it seems to work on filenames without their path. I am overwhelmed by the number of options.

3

While typing my question and reading the man page more thoroughly, it came to me that the answering flag is -g, so to extract from an archive a single directory into the current one, use:

dar -x archive-name -g dir/to/extract

According to the man page, dar features six different parameters for file selection, namely -I vs -X, -P vs -g and -[ vs -].

The interesting one to this question has the following description:

  -g, --go-into <path>                    

Files or directory to only take in account, as opposed to -P. -g may be present several time on command-line. Same thing here, the difference with -I is that the mask is applied to the path+filename and also concerns directories. By default all files under the -R directory are considered. Else, if one or more -g option is given, just those are selected (if they do not match any -P option). All paths given this way must be relative to the -R directory. This is equivalent as giving out of any option.
Warning, -g option cannot receive wildcards, these would not be interpreted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.