From owner-freebsd-questions@freebsd.org Sun Apr 17 22:33:37 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EF3AB11256 for ; Sun, 17 Apr 2016 22:33:37 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) by mx1.freebsd.org (Postfix) with SMTP id 637D41FEC for ; Sun, 17 Apr 2016 22:33:37 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from ::ffff:99.100.19.101 ([99.100.19.101]) by holgerdanske.com for ; Sun, 17 Apr 2016 15:30:51 -0700 Subject: Re: rm -rf -Mitigating the dangers To: freebsd-questions@freebsd.org References: From: David Christensen Message-ID: <57140EA2.6020503@holgerdanske.com> Date: Sun, 17 Apr 2016 15:30:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 22:33:37 -0000 On 04/17/2016 10:10 AM, Odhiambo Washington wrote: > I am wondering if I should place a feature request on this or just do it my > way:) > > With great power comes great responsibility and as such I think there > should be a wrapper around rm to warn sysadmins that what they are about to > do with -rf is dangerous, yes? > > Read input from sysadmin 3 times, looking strictly for their confirmation > before effecting the `rm -rf`. > > Could it be that what I am smoking/drinking is the issue here or I have > your support? LOL I have this in my .bashrc: alias rm='rm -i --one-file-system' So, an accidental 'rm -rf' should limit destruction to one file system. Perhaps what you're looking for is a command-line equivalent of desktop trash cans. STFW this is not a new idea and there are existing solutions. David