Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

39
votes
1answer
11k 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? ...
37
votes
7answers
13k 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 ...
31
votes
5answers
3k 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 ...
20
votes
8answers
3k 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?
19
votes
7answers
1k 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 ...
19
votes
4answers
937 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?
16
votes
1answer
2k 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 ...
14
votes
1answer
260 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 ...
12
votes
3answers
2k 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?
12
votes
1answer
377 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 ...
11
votes
1answer
1k 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 ...
10
votes
2answers
429 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? ...
10
votes
3answers
399 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: ...
10
votes
3answers
381 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?
10
votes
2answers
1k 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 ...
10
votes
1answer
360 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 ...
10
votes
1answer
493 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 ...
9
votes
4answers
2k 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/...
9
votes
2answers
553 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?
9
votes
2answers
301 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, ...
9
votes
2answers
177 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 "...
9
votes
3answers
864 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 ...
9
votes
4answers
2k 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 ...
9
votes
1answer
258 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 ...
8
votes
1answer
2k 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 (...
8
votes
3answers
539 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 ...
8
votes
3answers
876 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 ...
8
votes
3answers
1k 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" ...
7
votes
4answers
738 views

The C-x C-j binding for dired-jump stopped working

I used to have a keyboard shortcut for the following action: "Open the folder containing this file in Dired+, and place point (cursor) on the file" I believe it was C-x C-j, and I don't recall ...
7
votes
5answers
1k 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), ...
7
votes
3answers
568 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 ...
7
votes
2answers
1k 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?
7
votes
1answer
394 views

How can I add default shell commands for various file types?

When I use ! on a *.tar.bz2 file in Dired, I'm presented with the following prompt: ! on WANem_3.0_Beta2.tar.bz2: {3 guesses} [bunzip2 -c * | tar xvf -] -!- How can I add similar functionality for ...
7
votes
1answer
140 views

Marking files in dired with subdirectories

I'm trying to mark a set of files (including subdirectories' files) in dired matching a regex, so I do: C-U C-x d -alR RET e:/ RET Followed by %m and enter my regex. No matches. If, however, I ...
7
votes
1answer
142 views

Is it possible to open .iso file in emacs dired?

When I open .iso file in dired, I have to mount it a temp folder mount -t iso9660 foo.iso temp then navigate to that folder, read the files. Is it possible to open .iso file in dired directly? (...
7
votes
1answer
233 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 ...
6
votes
2answers
794 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 ...
6
votes
4answers
362 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 ...
6
votes
2answers
559 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 ...
6
votes
3answers
1k 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 ...
6
votes
4answers
442 views

Quickly jump to favorite folders

What I actually want I have deep folder structures and use about a dozen folders pretty far down the directory tree a lot. In Nautilus, I use bookmarks to get to them quickly. I want the same thing ...
6
votes
1answer
166 views

Follow symlinked directories in Dired

On a Linux machine I symlink some directories into my home directory like this: /home/mrdarcy: total used in directory 231 available 520120 drwxrwxr-x 3 4k 04-30 18:16 bin drwxr-xr-x 2 4k ...
6
votes
1answer
384 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: ...
6
votes
2answers
370 views

How to always kill dired buffer when deleting a folder?

If I'm in dired and have a subfolder with another dired buffer (a common situation when navigating up/down directory) and want to delete a folder, I hit Dx to mark for deletion, then execute. Emacs ...
6
votes
1answer
370 views

How can I keep dired in sync with a shell buffer?

I have some work that requires I move around between various sub-directories. Thus, the easiest way I have found to do that is to use dired. I also have to view some files (plain text or code), so ...
6
votes
1answer
134 views

How to move marked files or file under point in dired to a pre-defined directory?

I am trying to create a simple function for dired where I would be able to call the function on current (or marked) files and then quick move the current (or marked) files to a pre-defined directory. ...
6
votes
1answer
107 views

Sort by a suffix in file names in dired

I would like to sort the dired buffer by a suffix in the file names. For instance, with the following buffer content: /nixos/nix/store: total used in directory 140344 available 17530560 drwxrwxr-t ...
6
votes
3answers
266 views

Dired heading directory with text-properties to jump to parent directories

Speedbar has a nice feature wherein the directory heading at the top of a files/directory buffer contains various text properties for the user to jump to any of the parent directories by placing the ...
6
votes
3answers
700 views

How to view files ordered by extension in dired?

Instead of viewing dired buffers with files sorted by name, I want to view it with directories at the top followed by files grouped by extension (and then filename). Is there any package to install to ...
6
votes
2answers
1k views

Open file from dired in the same window — using the mouse

How do you configure emacs to open a file in the current window -- using the mouse -- when it is selected from a dired buffer? That is, when I open a directory and then select a file with the mouse ...