From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Howto remove file by owner name Date: Sun, 30 Aug 2015 15:02:35 -0700 (PDT) Message-ID: <656124e3-3a60-4f20-9946-63bddf712903@default> References: <> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1440972196 8516 80.91.229.3 (30 Aug 2015 22:03:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Aug 2015 22:03:16 +0000 (UTC) To: notbob , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 31 00:03:03 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZWAgj-0003zG-Tx for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Aug 2015 00:02:58 +0200 Original-Received: from localhost ([::1]:32829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWAgj-0000fk-HA for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Aug 2015 18:02:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWAgY-0000fR-7q for help-gnu-emacs@gnu.org; Sun, 30 Aug 2015 18:02:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWAgV-0003Rp-2Q for help-gnu-emacs@gnu.org; Sun, 30 Aug 2015 18:02:46 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:29127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWAgU-0003Rj-RX for help-gnu-emacs@gnu.org; Sun, 30 Aug 2015 18:02:42 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7UM2eMC012051 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 30 Aug 2015 22:02:41 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t7UM2ePM025299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 30 Aug 2015 22:02:40 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t7UM2ema001104; Sun, 30 Aug 2015 22:02:40 GMT In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106939 Archived-At: > IOW, when in dired, how does one flag files for deletion by owner > name? I am unable to locate anything on this subject. Two steps: 1. Mark those files, with `*' (instead of flagging them for deletion, with `D'). 2. Delete the files marked `*', using `D' (command `dired-do-delete'). To perform #1, you can use `M-(' or `* (' (command `dired-mark-sexp'). It prompts you for a sexp, which is then evaluated and used as a predicate, testing file and dir entries in the buffer. The sexp can refer to any of these variables (which are used only here): `mode' [string] file permission bits, e.g. \"-rw-r--r--\" `nlink' [integer] number of links to file `size' [integer] file size in bytes `uid' [string] owner `gid' [string] group (If the gid is not displayed by `ls', this will still be set (to the same as uid)) `time' [string] the time that `ls' displays, e.g. \"Feb 12 14:17\" `name' [string] the name of the file `sym' [string] if file is a symbolic link, the linked-to name, else \"\" `inode' [integer] the inode of the file (only for `ls -i' output) `s' [integer] the size of the file for `ls -s' output (ususally in blocks or, with `-k', in Kbytes) Examples: Mark zero-length files: `(equal 0 size)' Mark files last modified on Feb 2: `(string-match \"Feb 2\" time)' Mark uncompiled Emacs Lisp files (`.el' file without a `.elc' file): First, Dired just the source files: `dired *.el'. Then, use \\[dired-mark-sexp] with this sexp: (not (file-exists-p (concat name \"c\"))) If you use Dired+ then use variable `blks' instead of `s' (which is not a good name here). In this case, you would do this: M-( (equal uid "YOUR USER ID") RET That is, you would type (equal uid "YOUR USER ID") at the prompt, where YOUR USER ID is your user id (your UID). Yes, you didn't find any info about this, because the doc doesn't draw attention to it. There is even this longstanding comments in the source code (`dired-x.el') asking whether anyone uses it: ;; Does anyone use this? - lrd 6/29/93. ;; Apparently people do use it. - lrd 12/22/97. FWIW, I use it, and I added it as item `Mark If' to the `Mark' menu for Dired+, and I clarified the prompt a bit, to mention the predefined variables you can use in the sexp: Mark if (vars: inode,blks,mode,nlink,uid,gid,size,time,name,sym):