Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delete marked files from dired

64 views
Skip to first unread message

notbob

unread,
Jun 1, 2017, 6:10:19 PM6/1/17
to
I've gotta lotta files to delete before rsyncing to a thumb drive. I
know how to mark all files in a dir (* s) when in dired mode, but do not know how to
delete all those marked files. Anybody? ;)

nb

Marco Wahl

unread,
Jun 2, 2017, 1:31:36 AM6/2/17
to
*c*Dx

This is change the * marks to D marks (D for deletion). Then execute
(x).


Ciao

notbob

unread,
Jun 2, 2017, 11:40:52 AM6/2/17
to
On 2017-06-02, Marco Wahl <marcow...@gmail.com> wrote:

> *c*Dx
>
> This is change the * marks to D marks (D for deletion). Then execute
> (x).

Works like a champ! Thank you, so much, Marco. ;)

nb

notbob

unread,
Jun 14, 2017, 9:17:28 PM6/14/17
to
On 2017-06-02, notbob <not...@nothome.com> wrote:
> On 2017-06-02, Marco Wahl <marcow...@gmail.com> wrote:

>> *c*Dx

This still works, perfectly, but now, how do I "force" delete, so I
don't hafta answer y/n fer all recursive (filled) directories? ;)

nb

notbob

unread,
Jun 14, 2017, 9:34:15 PM6/14/17
to
I found this:

"You can delete empty directories just like other files, but normally
Dired cannot delete directories that are nonempty. If the variable
dired-recursive-deletes is non-nil, then Dired can delete nonempty
directories including all their contents. That can be somewhat risky."

So, how do I set the above named variable or, better yet, how do I
invoke it w/o changing my emacs config file? I've got some changes in
my ~/.emacs file, but I don't really understand 'em all. They were
suggestions by others, much like this Q. ;)

nb --not the sharpest knife in the emacs drawer

Ralf Fassel

unread,
Jun 15, 2017, 5:17:33 AM6/15/17
to
* notbob <not...@nothome.com>
| [...] If the variable dired-recursive-deletes is non-nil, then Dired
| can delete nonempty directories including all their contents. That can
| be somewhat risky."
>
| So, how do I set the above named variable or, better yet, how do I
| invoke it w/o changing my emacs config file?

M-x customize-variable RET dired-recursive-deletes RET

But make sure you really really really want to delete non-empty
directories (especially $HOME :-) without confirmation.

HTH
R'

notbob

unread,
Jun 16, 2017, 11:44:32 AM6/16/17
to
On 2017-06-15, Ralf Fassel <ral...@gmx.de> wrote:

> M-x customize-variable RET dired-recursive-deletes RET

The first part of yer solution works, but not the 2nd part. I get a
response of "[No match]". Backing up a bit and letting emacs do an
auto-completion only yields:

-----

Possible completions are:
dired-kept-versions
dired-listing-switches

-----

I use slrn fer news, but emacs is my general editor. This ona Slackware
14.1 box using emacs 24.3.1. ;)

nb

notbob

unread,
Jun 16, 2017, 11:53:39 AM6/16/17
to
OK, my bad. Turns out you gotta be IN dired mode fer the variable to
show up. I used another xterm to put me in an non-dired mode of emacs
and that does NOT work. Now all I gotta do is learn how the
"customize" screen works. Thank you. ;)

nb

Ralf Fassel

unread,
Jun 19, 2017, 5:21:26 AM6/19/17
to
* notbob <not...@nothome.com>
| OK, my bad. Turns out you gotta be IN dired mode fer the variable to
| show up. I used another xterm to put me in an non-dired mode of emacs
| and that does NOT work.

Might be that the variable is not known to emacs until dired-mode is
actually loaded.

| Now all I gotta do is learn how the "customize" screen works.

Might be easier to just put

(setq dired-recursive-deletes 'always)

in your .emacs (maybe accompanied by a comment indicating what this
does), but I thought the 'GUI'-approach might be the way to go these
days... :-)

HTH
R'

notbob

unread,
Jun 19, 2017, 9:03:58 PM6/19/17
to
On 2017-06-19, Ralf Fassel <ral...@gmx.de> wrote:

> Might be easier to just put
>
> (setq dired-recursive-deletes 'always)

Not sure if it is actually easier, but at least it works! Thank you,
Ralf.

Apparently, "nil" is not acceptable. I had "t" in there, before. With
"'always", it always seems to work. DUH!

Thank you to all you emacs fans. I asked this question a few yrs ago
and no one answered. Looks like we have some new blood. ;)

nb

Ralf Fassel

unread,
Jun 20, 2017, 6:33:27 AM6/20/17
to
* notbob <not...@nothome.com>
| On 2017-06-19, Ralf Fassel <ral...@gmx.de> wrote:
>
| > Might be easier to just put
| >
| > (setq dired-recursive-deletes 'always)
>
| Not sure if it is actually easier, but at least it works! Thank you,
| Ralf.

Da nich für... ;-)

| Thank you to all you emacs fans. I asked this question a few yrs ago
| and no one answered.

Must have missed your message then :-)))

| Looks like we have some new blood. ;)

Thanks for the flowers (my contributions to fortran.el date some time back :-)

R'
0 new messages