help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying files with dired preserving structure


From: Alberto Luaces
Subject: Re: Copying files with dired preserving structure
Date: Mon, 11 Jan 2016 10:24:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Martin writes:

> Alberto Luaces writes:
>
>> Hi,
>>
>> I want to classify some files contained in a directory hierarchy into
>> several groups, depending on their content.
>>
>> So far I do a 'find-dired' to get a list of the available files and then
>> I mark each group by grepping into the files
>> (dired-mark-files-containing-regexp).
>>
>> The problem is that if I try now to move those files elsewhere, the
>> hierarchy is lost, and besides that, files with the same name are
>> overwritten.
>>
>> I have tried to "tar" the marked files to preserve the hierarchy, but
>> this approach is somewhat fragile, as I tend to use incorrect tar flags
>> and I risk corrupting my work when updating some of those "groups".
>>
>> I am looking for a way to move marked files to a different place
>> preserving the directory structure with dired.
>>
>> Thanks,
>
> Hi,
>
> you may want to use dired-do-(async-)shell-command with
> "cp ? --parents <target directory>".

Great! It does the trick!

Thank you, Martin.

-- 
Alberto




reply via email to

[Prev in Thread] Current Thread [Next in Thread]