Hi How can I use emacs find to list files without their detailed information?

C-x C-f

What I got:

-r--r--r-- user 3845 Apr 10 2014 ua.cpp
-r--r--r-- user 3845 Apr 10 2014 ub.cpp
-r--r--r-- user 3845 Apr 10 2014 uc.cpp

What I want:

ua.cpp ub.cpp uc.cpp
  • Why not M-! ls ? – djangoliv Jul 7 '16 at 6:51
  • 2
    I suggest using the dired+ package with diredp-hide-details-initially-flag set to t. – caisah Jul 7 '16 at 6:59
  • 1
    Did you mean C-x d instead of C-x C-f? – Drew Jul 7 '16 at 13:48

M-x list-directory (key C-x C-d) is probably what you want?


M-x dired, then M-x dired-hide-details-mode

If you always want to hide detail, add a hook. Like this:

(add-hook 'dired-mode-hook 'dired-hide-details-mode)

If you really want them all in a single line, M-x shell-command (M-!) and ls -m is probably the best.

Or, better I think is just M-x eshell, then do ls.

  • 2
    (add-hook 'dired-mode-hook 'dired-hide-details-mode) would also work. – npostavs Jul 7 '16 at 10:34
  • thx @npostavs, I'll edit to use your suggestion. – Xah Lee Jul 8 '16 at 7:07

You can use whatever ls switches (command-line options) you want, for any particular Dired listing, by using a prefix argument with the Dired commands. For example: C-u C-x d. You are prompted for the ls switches to use.

And you can set your own preference for the ls switches to use by default each time, just by customizing user option dired-listing-switches:

M-x customize-option RET dired-listing-switches RET

Then, each time you use Dired, you will get the kind of listing you prefer, and if you ever want to override your preference you just use a prefix argument (C-u).

And whenever you are in Dired you can toggle whether to show the details (whatever they are, as determined by the ls switches), using (.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.