From: Drew Adams <drew.adams@oracle.com>
To: notbob <notbob@nothome.com>, help-gnu-emacs@gnu.org
Subject: RE: Howto remove file by owner name
Date: Sun, 30 Aug 2015 15:02:35 -0700 (PDT) [thread overview]
Message-ID: <656124e3-3a60-4f20-9946-63bddf712903@default> (raw)
In-Reply-To: <<d4goqbFitf6U1@mid.individual.net>>
> 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):
next parent reply other threads:[~2015-08-30 22:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<d4goqbFitf6U1@mid.individual.net>
2015-08-30 22:02 ` Drew Adams [this message]
2015-08-30 16:20 Howto remove file by owner name notbob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=656124e3-3a60-4f20-9946-63bddf712903@default \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=notbob@nothome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.