From owner-freebsd-questions@FreeBSD.ORG Wed May 4 07:44:46 2011 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522C2106564A for ; Wed, 4 May 2011 07:44:46 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8E88FC0A for ; Wed, 4 May 2011 07:44:46 +0000 (UTC) Received: by pvg11 with SMTP id 11so508744pvg.13 for ; Wed, 04 May 2011 00:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:date:message-id:subject :from:to:cc:content-type; bh=iHtiW5Zcex44yIxNM4bPDh/HZaHdt0o0/y/+MUUQ2+M=; b=qnO0H04UOg2jh4TM6LqoPyywnxhdy1LScul3mrPQ6wYy7DS9A1PNpaXhcD0zN3UMkX eovG/RuL2XbAdawqtBJECnt17hsIFbGlss7+kklN5Ukk6y22bBaICy2TjQbRT1WlFbEo Voowu3D+vnpdwshQP+Tl1IZurRKOsrUHhK9aY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=sK1UYBSdV4eIWwxyItw9AzzM5a8/973dkrLZUpw6XR9nML096iBvgpFekEakH/+YGY l2SwAa4qvUzwK8KteLFfdUV7xosDRb36mC242d8cGsBoDGNK/uVPmYCy7CwjyBLHj+ny 1OGS5kAeZqWVpjgI0NGQVYw5ta+PQxA+uwPMo= MIME-Version: 1.0 Received: by 10.68.64.97 with SMTP id n1mr1224638pbs.251.1304495085669; Wed, 04 May 2011 00:44:45 -0700 (PDT) Received: by 10.68.55.136 with HTTP; Wed, 4 May 2011 00:44:45 -0700 (PDT) Date: Wed, 4 May 2011 03:44:45 -0400 Message-ID: From: "b. f." To: Modulok Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@FreeBSD.org Subject: Re: Piping find into tar... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2011 07:44:46 -0000 > I've been playing with the find command lately. Is there a way I can pipe the > putput list of files from find, into the tar command to create an archive which > contains the files which find lists? I tried the following, but it didn't work > (obviously). > > find -E . '.*\.txt$' -print | tar -cjf result.tgz You could use something like: find -X . -name '*.txt' | xargs tar -cjf result.tgz or find . -name '*.txt' -print0 | xargs -0 tar -cjf result.tgz b.