Questions tagged [dired]

Dired is a major mode that allows users to edit files and directories on a file system. It is essentially a file browser, with a wide range of features and an appearance similar to the `ls` command.

Filter by
Sorted by
Tagged with
97 votes
5 answers
33k views

Edit file with super-user rights

When you have to edit system files, it's an usual situation that you launched Emacs with a normal user before, so the file will be write-protected. What can I do to gain root privileges? I mean ...
smonff's user avatar
  • 1,579
68 votes
4 answers
32k views

How to quickly copy/move file in Emacs Dired?

In Dired mode, I can m mark files and R to move them to a destination. Some times the destination path is too long. With the destination open in a split window, is there a way to move files quicker? ...
Nick's user avatar
  • 4,463
49 votes
7 answers
35k views

Tree-based directory browser?

I love dired, but sometimes (particularly when filming screencasts) I want to see the tree-structure of a directory and its children, a la the tree(1) command. Is there a tree-oriented directory ...
Avdi's user avatar
  • 737
43 votes
4 answers
9k views

Why can't I list the contents of Desktop on macos using dired?

When I do C-x C-f on ~/Desktop/ in macos Catalina, I get the following error. Listing directory failed but 'access-file' worked I can list the directory for just ~. I'm new to Emacs and know little ...
user avatar
37 votes
5 answers
5k views

Is there a way to use query-replace from grep/ack/ag output modes?

I'm aware of find-grep-dired, marking the corresponding files and then pressing Q to run dired-do-query-replace-regexp on the marked files. Unfortunately that requires restarting the grep and no ...
dgtized's user avatar
  • 4,199
27 votes
2 answers
6k views

Current path in Dired or Dired+ to clipboard

Say we have a Dired buffer open on some directory. How can I send the directory path to the clipboard? Also, how can I do the same when the Dired cursor is on a specific file, without opening the ...
Amelio Vazquez-Reina's user avatar
26 votes
8 answers
7k views

Close all dired buffers

Sometimes my buffer list has 10+ dired windows, and I end up using buffer-menu to manually mark and kill all of them. Is there a faster way to close all open dired windows?
nispio's user avatar
  • 8,215
21 votes
4 answers
2k views

How to set emacs as the default file manager?

Some programs like firefox have buttons that when clicked open a file manager for browsing files. How do I make it to open in emacs with dired mode on Debian Linux?
godblessfq's user avatar
  • 1,217
19 votes
7 answers
14k views

Simple ways to copy/paste files and directories between dired buffers

Is there a simple M-w C-y approach to copy paste files and directories between two dired buffers? I mean marking some items (files and buffer) by m then copying them by M-w (or another shortcut), ...
Name's user avatar
  • 7,809
19 votes
7 answers
5k views

Dired "quick-view" key to preview the file at point

I would like to create a function that does a "quick view" of a file the is under point in dired. The way that I would like for this to work is that I hold down a function key, which then makes the ...
Eric Brown's user avatar
  • 3,222
18 votes
3 answers
4k views

Dired+ missing from MELPA

I am trying to install dired+ from MELPA but it seems that it no longer is listed. I also checked here: https://melpa.org/ Is this normal?
Tohiko's user avatar
  • 1,629
17 votes
2 answers
7k views

Finding files by names

How can I bring all files with names that conform a specific regex, recursively in a directory tree, to a single dired buffer? So I can rename/delete them all at once?
iLemming's user avatar
  • 1,253
15 votes
4 answers
4k views

Recursively open files matching regexp in marked directories

Generally speaking, I would like to be able to open all files within a given set of directories (and their subdirectories) where the filename matches a given regexp. For example /home/nispio/...
nispio's user avatar
  • 8,215
15 votes
2 answers
6k views

Tramp/Dired transfers files inline over ssh instead of using scp externaly

I am using tramp via ssh to access remote files. For text files, this is working really well, but whenever I want to copy larger remote files to my local machine, tramp uses its slow inline method (...
Chris's user avatar
  • 252
15 votes
1 answer
5k views

how to deal with ZIP archives in DIRED?

I want to work easier with archives in Emacs dired-mode. And I think that my needs are not only mine. What I want? Two things in Dired: z to zip file or dir on cursor (or all marked files/dirs if ...
drobnbobn's user avatar
  • 585
15 votes
2 answers
1k views

Display recursive folder sizes in-line in dired?

I'd like to display the recursive size (the value that would be reported by du) of folder contents in-line in the dired buffer as an additional column or in place of the directory file size. Is this ...
ebpa's user avatar
  • 7,439
14 votes
2 answers
4k views

How to mark all files in the current dired directory?

I want to mark all the files in the current dired buffer. Is there a command for this? Not including . and ... My use case is hardlinking all the files in a directory and I always reach for M which ...
salotz's user avatar
  • 1,390
14 votes
1 answer
387 views

In dired buffers, place point on the most important file of that directory

90% of the time I visit a directory in Emacs, the first thing I do is move point to a specific file and open it. A lot of times, the file I need to open is very predictable. For instance: If there ...
Malabarba's user avatar
  • 23.1k
14 votes
1 answer
2k views

dired - sort and hide by default

More often than not, when I open a dired buffer, I press ( to run dired-hide-details-mode s to rundired-sort-toggle-or-edit What's a good way to have these done automatically every time I open a ...
dharmatech's user avatar
  • 1,242
12 votes
3 answers
1k views

Sort file names (numbered) in dired

When Dired sorts files by name, it sorts in alphabetical order. That's fine with letters; however, when the file names start with numbers, it would be better to sort in numerical value. Example: ...
Nick's user avatar
  • 4,463
12 votes
1 answer
5k views

How to rename a file with dired with the current file name as default?

In the macOS Finder, I can rename a file or directory by pressing RET and the current value becomes the default for the new file name. This helps if I make a small change, such as adding a date at the ...
miguelmorin's user avatar
  • 1,897
12 votes
1 answer
789 views

How to stop dired printing "Reverting buffer ..."

After setting dired-auto-revert-buffer to t, even when I'm working on a buffer of file that may produce some results, the message keep printing if there is a dired buffer behind current buffer. This ...
Saddle Point's user avatar
12 votes
1 answer
807 views

How to use Dired marked files as arguments to arbitrary Emacs Lisp functions?

Dired lets me mark files and pass their names as arguments to arbitrary shell commands. I would like a way to supply the marked names as arguments to Emacs Lisp functions, either built-in or those I ...
Low Powah's user avatar
  • 317
12 votes
4 answers
7k views

Emacs: how to open and play a video file

If I am exploring my file system in Dired-mode and I come across a video file, for example, it would be nice to be able to play that video file. How can I do this in Emacs? I can use Emacs to open a ...
modulitos's user avatar
  • 2,472
11 votes
2 answers
794 views

Programmatically insert files into Dired buffer

I have a list of file names (with full path) and I want to create a Dired buffer listing this set of files. How would I go about doing that? How do I create a Dired buffer from a list of file names? ...
Tu Do's user avatar
  • 6,812
11 votes
2 answers
3k views

Dired. First show list of folders

Windows 10, Emacs 25.1, Dired+ Here example of my folder's content: As you can see the files and folder are mixed. But I want first to show list of folders and after show list of files. Is it ...
a_subscriber's user avatar
  • 4,010
11 votes
3 answers
4k views

How to sort directories first in dired?

I add (setq dired-listing-switches "-lXGh --group-directories-first") in my init.el But when I go into dired mode. ls does not support --dired; see ‘dired-use-ls-dired’ for more details. insert-...
Jay Lee's user avatar
  • 323
11 votes
2 answers
2k views

Dired as an FTP client

I don't know whether this is possible or not. I know I can edit remote files, but what I am looking for is a setup like this: one buffer with dired on my local directory one buffer with dired on the ...
Boccaperta-IT's user avatar
11 votes
4 answers
2k views

How can I run a keyboard macro in selected buffers from Ibuffer or selected files from dired?

If I have to do some variable name refactoring, I use ag and multiple-cursors. But when I have to do some code block removal/addition/moving, I use keyboard macros. But I need to switch to each ...
Kaushal Modi's user avatar
  • 25.6k
11 votes
2 answers
11k views

Is there a table of Evil keys for Dired?

I am learning Dired in Evil mode. h j k l / are Evil keys that obviously work in Dired. Are there others? Is there a table of Evil keys for Dired? I am using Emacs 25.2.1 with Evil, Spacemacs, and ...
wolfv's user avatar
  • 1,393
10 votes
3 answers
745 views

Get all filenames in current Dired buffer with Elisp

As the title suggests, how do I get all the file entries in a Dired buffer using Elisp?
Tu Do's user avatar
  • 6,812
10 votes
2 answers
636 views

How can I make Dired buffer names include the full path?

I often have many dired buffers open, including some for folders that have identical names. Occasionally, this causes me to switch to the wrong one, so I am looking for a way to fix this. Currently, ...
Scott Weldon's user avatar
  • 2,695
10 votes
2 answers
405 views

How to avoid typing "space" after "^" for moving up in directory in dired?

^ is the key binding for moving to the parent directory in dired ("Up directory"). However, in Gnu Emacs on Windows 7 Professional 64-bit with my German keyboard layout, it is not sufficient to type "...
MostlyHarmless's user avatar
9 votes
1 answer
3k views

How to only show the file/directory column in a Dired buffer

When visiting a directory: In the view that comes up, I want the file/directory names to be in the left-most column. How can I do that?
Kirill Yunussov's user avatar
9 votes
2 answers
2k views

How show size in KB in dired mode?

Windows 10 (64 bit), Emacs 25.1, package dired+. In dired mode files size show in bytes. But I want to show in KB.
Alex's user avatar
  • 801
9 votes
3 answers
3k views

How to use "o" to open from dired/ibuffer into another frame

I have two windows open and split vertically (single frame): A) contains my work B) contains either dired or ibuffer. I would like to be able to navigate to a file/buffer in pane B and hit "o" ...
Robert's user avatar
  • 99
9 votes
3 answers
2k views

How can I visualize VCS status in dired?

I'm particularly concerned with git, but I imagine this is a good place to use vc. I want to emulate Atom's git integration with its file explorer: How can I get something like this in dired? I ...
Sean Allred's user avatar
  • 6,901
9 votes
2 answers
790 views

How can I create a dired buffer listing all open files?

I have a mechanism for burning items to disc from a dired buffer. Unfortunately, the file's I've patched are strewn accross the file system. How can I create a dired buffer from all open files?
Sean Allred's user avatar
  • 6,901
9 votes
4 answers
2k views

Dired: only reuse buffer for directories

To prevent creation of a buffer every single time I enter a directory in dired I use this: (put 'dired-find-alternate-file 'disabled nil) My problem now is that when I visit a file from dired ...
Boccaperta-IT's user avatar
9 votes
1 answer
2k views

Is it possible to load Dired+ automatically with use-package?

I'm trying to add dired+ to my init.el with use-package but I can't seem to find the name of dired+ on any of the package repositories ( marmalade, melpa or elpa ). I'd been able to add dired+ after ...
Fabman's user avatar
  • 578
9 votes
1 answer
2k views

Why doesn't (use-package dired) work for me?

(use-package dired) complains: Debugger entered--Lisp error: (error "Package ‘dired-’ is unavailable") But I see others' emacs configurations do use (use-package dired), for example: https://github....
Croad Langshan's user avatar
9 votes
1 answer
10k views

How show hidden and system folder/files?

Emacs 26.1. , Dired+ Here content folder TraderMonitor in Total Commander: and here how look same folder (TraderMonitor) in Emacs, dired mode: How show hidden/system folders: .git .idea and file: ...
a_subscriber's user avatar
  • 4,010
9 votes
1 answer
2k views

Copy to kill-ring selected file names/full path

windows 10, emacs 25.1, dired+ Suppose in folder I select 3 files. Something like this: Now I want 2 options: Copy to kill-ring the selected files names. So the result must be: ...
a_subscriber's user avatar
  • 4,010
9 votes
1 answer
557 views

How to prevent tramp locations from interfering in history?

I have an issue where if I try to perform some random Emacs operations such as org-capture, or renaming a file to a different (local) directory in dired, Emacs attempts to contact a different machine ...
Lee H's user avatar
  • 2,727
8 votes
3 answers
2k views

How to grep marked files in the dired mode of emacs?

I hope it's a simple problem.. I'd like to search for the regexp 'thisWord' only in the marked files of a dired buffer. Usually I used in the dired buffer: M-x grep and then in the mini-buffer grep ...
rl1's user avatar
  • 356
8 votes
3 answers
864 views

Search and replace through a multifile project in AUCTeX?

I am about to adopt Emacs to be the only editor I use in all what I am writing including LaTeX documents. I came from WYSIWYG editor which served that purpose fairly nice, namely TexStudio or TXS for ...
doctorate's user avatar
  • 1,809
8 votes
1 answer
1k views

Dired+. Mouse click - open folder in the same window

When I open a folder by pressing "Enter" it will open in the same window: This behavior is OK and basically what I expect. But when I try to open a folder by clicking with the left mouse button the ...
user8542613's user avatar
8 votes
1 answer
595 views

Thumbnail previews of PDF files

If I select image files in a Dired buffer and do C-t C-t, a nice little thumbnail appears. But if I try this with PDF files, nothing happens. I would expect to see a thumbnail of the first page of the ...
Brian Z's user avatar
  • 2,913
8 votes
1 answer
762 views

Insert all subdirectories in Dired

How can I insert all the subdirectories of the toplevel directory in Dired? And how can I insert the whole directory tree, i.e. all the subdirectories recursively? I don't want to change the default ...
Gilles 'SO- stop being evil''s user avatar
7 votes
4 answers
683 views

Copy all file names that match regexp

In a dired buffer of a directory, how do I copy the file names of all files matching [tT]ypolog[yi]? Getting them from an elisp list format, \n separated format or otherwise into a python list format ...
Anaphory's user avatar
  • 240

1
2 3 4 5
11