Sure, by default the command M-! (shell-command
) outputs shell output to a default output buffer.
M-! objdump -D /bin/ls
If you want to change the name of the output buffer, you can invoke shell-command
through some elisp:
(shell-command "objdump -D /bin/ls" "ls.dump")
or
C-x C-w (write-file
) - to write the shell output buffer to a file
Edit:
Example which grabs file at point if available, or prompts the user
(defun my-objdump-file (&optional file)
(interactive)
(unless file
(setq file (expand-file-name (or (thing-at-point 'filename)
(read-file-name "File: ")))))
(when file
(shell-command (concat "objdump -D "
file)
"*Objdump Output*")))