Hi,
How can I list the output of this command
ls -ltDR `find . -maxdepth 4 -type f -name "*.org"`
within dired-buffer. The above command lists all org files sorted by access time.
Thanks,
Sandeep
Hi,
How can I list the output of this command
ls -ltDR `find . -maxdepth 4 -type f -name "*.org"`
within dired-buffer. The above command lists all org files sorted by access time.
Thanks,
Sandeep
You want to use M-x find-dired
, with a custom value for the find-ls-option
variable.
find-dired:
find-dired is an interactive compiled Lisp function in `find-dired.el'.
(find-dired DIR ARGS)
Run
find
and go into Dired mode on a buffer of the output. The command run (after changing into DIR) isfind . \( ARGS \) -ls
except that the variable `find-ls-option' specifies what to use as the final argument.
find-ls-option:
find-ls-option is a variable defined in `find-dired.el'. Its value is
("-exec ls -ld {} \\;" . "-ld")
Documentation: Description of the option to
find
to produce anls -l
-type listing. This is a cons of two strings (FIND-OPTION . LS-SWITCHES). FIND-OPTION gives the option (or options) tofind
that produce the desired output. LS-SWITCHES is a list ofls
switches to tell dired how to parse the output.
First open dired buffer using M-x dired
Sorting by access time in dired buffer
You can change the sort command used to order the dired buffer.
To sort by access time...
C-u s
this will bring up a minibuffer and you type -lutR
The R will make dired recurse subdirectories
Showing only .org files
Following info from this thread here works:
http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/acb20ee78c00e4ec#
(Andreas Politz)
Here is one way :
dired-do-kill-lines' with
k' Wrapped up in a 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)