Sorted list files sorted by access time

How can I list the output of this command

ls -ltDR \`find . -maxdepth 4 -type f -name "*.org"\` 

in a fading buffer. The above command lists all org files sorted by access time.

+6
emacs dired
source share
2 answers

First open buffer using Mx dired

Sort by access time in buffer with buffer

You can change the sort command used to order the buffer.

Sort by access time ...

Cu s

this will call the minibuffer and you type -lutR

Subdirectories of dired recurse will be created in R

Display only .org files

The following information from this topic works here:

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/acb20ee78c00e4ec#

(Andreas Politz)

Here is one way:

  • Check all the files you want to see with `% m '
  • The expression needed for .org files is ..org
  • Backticks with `* t '
  • Call dired-do-kill-lines' with k'
  • When done, reset listing with `g '

Completed function:

 (defun dired-show-only (regexp) (interactive "sFiles to show (regexp): ") (dired-mark-files-regexp regexp) (dired-toggle-marks) (dired-do-kill-lines)) (define-key dired-mode-map [?%?h] 'dired-show-only) 
+7
source share

You want to use Mx find-dired with a custom value for the find-ls-option variable.

find in Dired:

find-dired is an interactive compiled Lisp function in `Find-dired.el".

(search for DIR ARGS)

Run find and switch to Dired mode in the output buffer. Run a command (after switching to DIR)

 find . \( ARGS \) -ls 

except that the variable `find-ls-option 'indicates what to use as the last argument.

find-LS option:

find-ls-option is a variable defined in find-dired.el. Its meaning

 ("-exec ls -ld {} \\;" . "-ld") 

Documentation: Description of the find parameter to create the ls -l list. These are the cons of two lines (FIND-OPTION. LS-SWITCHES). FIND OPTION gives an option (or options) for find , which return the desired result. LS-SWITCHES is a list of ls switches to tell you how to parse output.

+2
source share

All Articles