From owner-freebsd-questions@freebsd.org Sat Feb 15 13:41:43 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53BA623B544 for ; Sat, 15 Feb 2020 13:41:43 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from gate.utahime.jp (gate.utahime.jp [183.180.29.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48KWck0NTRz4GHT for ; Sat, 15 Feb 2020 13:41:41 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gate.utahime.jp (Postfix) with ESMTPS id C46EC5189E for ; Sat, 15 Feb 2020 22:41:29 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1581774089; bh=sVPrS+8MG9bQiLa8gsCzRHY1GyYesZiCgDuuSouglmE=; h=Date:To:Subject:From:In-Reply-To:References; b=so7tYKFETxhuh/yR2+/BxXH/A79fuBkWUUqYoOIBFKd8Zgao2YQz/rYDdJ6hyqKKB vnD5K5DiwkTCka103pb1KaT5gb76PUJ2cuFRnhK8ZCPDYQX+M466ZnfB0yeIzM7Nem mDr5zEv9aXzz70SawZFPSTi93R+qkSgJwUCBYe55+Vg+xpV6snfMt/15My2ZCZrS+M O5NnaFYfuO5DehQ/VPwP4Pnxr+ZrHTbKQBlmPfTAzwxuw4mnlyxyV1jC+tVDZzUvbm kACwL4KD/DnHXq1dwf2CHBU8Xr9O3M7ajP+a2MuU0T55439W8CVXebcofFQK9jzZDp 4YGxfx4f6lKAg== Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id D912ACB79; Sat, 15 Feb 2020 22:41:25 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at eastasia.home.utahime.org Date: Sat, 15 Feb 2020 22:40:40 +0900 (JST) Message-Id: <20200215.224040.865767451214861597.yasu@utahime.org> To: freebsd-questions@freebsd.org Subject: Re: Removal script From: Yasuhiro KIMURA In-Reply-To: <24af365c-bfab-b5ac-72e3-675b0450b75f@cloudzeeland.nl> References: <24af365c-bfab-b5ac-72e3-675b0450b75f@cloudzeeland.nl> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48KWck0NTRz4GHT X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=so7tYKFE; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [-0.29 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; NEURAL_HAM_MEDIUM(-0.76)[-0.763,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.91)[-0.913,0]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[utahime.org]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[utahime.org:+]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.38)[ip: (0.21), ipnet: 183.180.0.0/16(0.11), asn: 2519(1.55), country: JP(0.04)]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Feb 2020 13:41:43 -0000 From: Jos Chrispijn Subject: Removal script Date: Sat, 15 Feb 2020 14:31:59 +0100 > I am looking for a way to remove a nested subdirectory in a directory. > > Example: > directory /mysources has a certain number of subdirectories which > contain subdirectory 'nonsense' in various subdirectories, which > contain also subdirectory 'nonsense', etc. > > What I would like to do is that the script removes all 'nonsense' > folders in the base /mysources. > Can you pls tell me how I can do that savest? Thanks! Does 'nonsence' have subdirecties and should they also be removed? If answer is yes, try find /mysources -type -d -name nonsense -exec rm -rf {} + --- Yasuhiro KIMURA