ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Vladimir D. Seleznev" <vseleznv@altlinux.org>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] Копирование файлов по типу
Date: Wed, 20 Oct 2021 15:56:00 +0000
Message-ID: <YXA8EB3CWS03yU7Z@portlab> (raw)
In-Reply-To: <20211020142431.53e774cb@tower>

On Wed, Oct 20, 2021 at 02:24:31PM +0300, Anton V. Boyarshinov wrote:
> В Wed, 20 Oct 2021 13:44:43 +0300
> А. Куликовский <kae@tut.by> пишет:
> 
> > Проблема: есть дерево каталогов со смесью файлов разных типов. Нужно 
> > скопировать (перенести) все файлы только определённых типов в другое 
> > место _с сохранением структуры каталогов_. Можно с консоли или в MC.
> 
> Я в таких случаях копирую всё дерево через cp -al (чтоб не занимать
> лишнего места), а потом удаляю лишнее при помощи 
> find -not -name '*.type' -delete

У этого решения есть проблема, что скопированные файлы представляют
собой жёсткие ссылки, что может быть нежелательно. Но это легко
исправить с помощью следующего рецепта:

	find $dir -type f -exec sed -i ';;' '{}' ';'

где $dir -- каталог, в который копировались файлы.

-- 
   WBR,
   Vladimir D. Seleznev


  reply	other threads:[~2021-10-20 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:44 А. Куликовский
2021-10-20 11:06 ` Alexei Mezin
2021-10-20 11:14   ` Alexei Mezin
2021-10-20 11:24 ` Anton V. Boyarshinov
2021-10-20 15:56   ` Vladimir D. Seleznev [this message]
2021-10-20 18:32 ` Andrey Savchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YXA8EB3CWS03yU7Z@portlab \
    --to=vseleznv@altlinux.org \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git