From owner-freebsd-questions@freebsd.org Sun Jul 1 19:54:04 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18BAFD5E8A for ; Sun, 1 Jul 2018 19:54:03 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767657B787 for ; Sun, 1 Jul 2018 19:54:03 +0000 (UTC) (envelope-from kurt.buff@gmail.com) Received: by mail-oi0-x229.google.com with SMTP id d189-v6so4145464oib.6 for ; Sun, 01 Jul 2018 12:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=il0LLpnepFUpw3eZYHES09kHd1uajFhgaVFg/LyeOKM=; b=KOpBQ4QPYzoMDU78PGg88exluh+yY7pj42QlVzDgvvehBUm07eMpQ/CeWujGy0I3Hh DIb1EJtZkaO6OPiSLLP1p7RCH/X3E5m8Ruh8doAJhXlfLoVqV5Zw/mja6xp5deUBYEkO y06b4275VNAO4CLXq+9OJ2i2Ud7H/bAREY0r8nJKgCshUgAvLhOgayWJ/kEA2e8NTXHD FMI6ER3AAN5vFcXQFuED/38vIMamsKR+HC1vIeJfxB6N89MVfMr75RF3BJ8Zv9vy3SQj LdTGieA+VBTWEf/SwteIp1J6Nm5kBz9s+WQUW40sJhrwEo3F0lzloQx/0iPHYNpOvPsU UDdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=il0LLpnepFUpw3eZYHES09kHd1uajFhgaVFg/LyeOKM=; b=c4/rLoiQXMt7iDJNdGWJRLTTcWJKBexNJadP9WV9mZC7MQi3MwPgMAV9rmMFlpqMVN eqhpMgbwX4+Ki01ZIrwWq6MaVCx1igCgPXwVNnUk4oCaqj+kcjkj7qPGQhztdSHZaqhV pQUIxVnDD5Q3Cbzn8YdGxXKpoqJk8Jz7OxfIXnz4opxtWYifQrrGJyu+a71EthbvJoEJ vfWnG+954gyUZfQKxyFfM4pk2Dc75YO3QWr8Z1lgP0J+MAIy5tUUOtNmAudi/lFrIR85 +qLNo4U/FFJaQ/pDJJjLNAxk1uBbKwU53LKkbZ+ZGmh6V6cC55eZHueRJmtjcmtzxv4S IXlA== X-Gm-Message-State: APt69E08VyL7zMm7QuJ+xt/0Vg6l12rfF5V1ttnAZOc84+8LqCED5bGq RsiHX+wpErjxVyJAbvDHwSG3DNcxSnoDcNprqQc= X-Google-Smtp-Source: AAOMgpcrh/YpES+Hw8+Zlyvy736x07BtokBvvVWlw/4HnlB3IV0YTlYZt4tHYMvbIFt/TV9U6pZFlxhUf52h8nv7Z4o= X-Received: by 2002:aca:bc54:: with SMTP id m81-v6mr7966900oif.308.1530474842503; Sun, 01 Jul 2018 12:54:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:12b3:0:0:0:0:0 with HTTP; Sun, 1 Jul 2018 12:54:02 -0700 (PDT) In-Reply-To: <85B4CFC22AC0CA70B917D42D@Pauls-MacBook-Pro.local> References: <85B4CFC22AC0CA70B917D42D@Pauls-MacBook-Pro.local> From: Kurt Buff Date: Sun, 1 Jul 2018 12:54:02 -0700 Message-ID: Subject: Re: Problem deleting files To: FreeBSD Questions Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 19:54:04 -0000 On Sun, Jul 1, 2018 at 12:13 PM, Paul Schmehl wrote: > I have a problem with a directory full of files that I can't seem to delete. > > rm * returns argument list too long. So does file * > > find . -type f -exec rm [] \; returns rm: []: No such file or directory over > and over again. > > ls | wc -l shows there's files there. > ls | wc -l > 5023368 > > And ls -l actually lists the files: > -rw------- 1 root wheel 134 Jun 7 2015 > sess_19n679i71prvju8nuqsvd727o4 > > If I try to delete that specific filename, it seems to work. (Running rm > twice returns no such file the second time.) Yet the file count remains the > same. > > I also tried rm -fr | ls -l | awk '{print $9}', which returned a list of > filenames but didn't delete any of them. > > Nothing I've tried to delete these files seems to work. What can I do to get > rid of these files? > > Paul Schmehl > Independent Researcher That the file count remains the same even after deleting a file seems a bit suspicious. I'm not sure what to make of that. But, perhaps a piecemeal approach? Assuming the files all begin "sess_", perhaps start with 'rm sess_0*', then 'rm sess_1*', etc. Tedious to be sure, and you might have to combine that approach with the 'find' incantation you've also tried, but seems worth a try. Even more tedious, but also worth trying: 'ls /directory > /root/out.txt' and then loop through that file with rm. Kurt