From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Newsgroups: gmane.emacs.help Subject: Re: Copying files with dired preserving structure Date: Sun, 10 Jan 2016 06:06:19 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452402620 29565 80.91.229.3 (10 Jan 2016 05:10:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 05:10:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 06:10:19 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aI8Gg-0003tA-Nz for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jan 2016 06:10:18 +0100 Original-Received: from localhost ([::1]:45326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aI8Gf-0004KG-Sj for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jan 2016 00:10:17 -0500 Original-Path: usenet.stanford.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: 5bS2vme6HZmQJEq0Kfzvew.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (cygwin) Cancel-Lock: sha1:BqiJojR7NKnTZimwtbhYR47wKqw= X-Notice: Filtered by postfilter v. 0.8.2 Original-Xref: usenet.stanford.edu gnu.emacs.help:216394 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108684 Archived-At: 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 ". Martin