From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alberto Luaces Newsgroups: gmane.emacs.help Subject: Re: Copying files with dired preserving structure Date: Mon, 11 Jan 2016 10:24:26 +0100 Message-ID: <874mekeaet.fsf@eps142.cdf.udc.es> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452504301 31696 80.91.229.3 (11 Jan 2016 09:25:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jan 2016 09:25:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 11 10:24:50 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 1aIYiY-0006I1-B1 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jan 2016 10:24:50 +0100 Original-Received: from localhost ([::1]:52827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIYiX-00020H-Jv for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Jan 2016 04:24:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIYiO-00020A-HX for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 04:24:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIYiK-0002WM-Gq for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 04:24:40 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:44168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIYiK-0002WF-A1 for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 04:24:36 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aIYiI-00069R-7b for help-gnu-emacs@gnu.org; Mon, 11 Jan 2016 10:24:34 +0100 Original-Received: from 180eps.cdf.udc.es ([193.147.37.180]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jan 2016 10:24:34 +0100 Original-Received: from aluaces by 180eps.cdf.udc.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jan 2016 10:24:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 180eps.cdf.udc.es User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:iX4iDIL5OPYU1aCQof2LrUCCw64= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:108690 Archived-At: 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 ". Great! It does the trick! Thank you, Martin. -- Alberto