3

I know how to open/edit files in Emacs as root with sudo, using Tramp. I wonder if there is a way to run Emacs commands with sudo too, without opening a shell?

Something like:

sudo M-x find-name-dired

or

M-x sudo find-name-dired

for example.

Thorsten
  • 3,451
  • 3
  • 20
  • 25

1 Answers1

5

If your command involves some path on the filesystem it is possible to take advantage of tramp like this: M-x find-name-dired RET /sudo::/your/path.

Victor Deryagin
  • 11,895
  • 1
  • 29
  • 38
  • Thanks, that is already half the solution I was looking for, and helps a lot. Maybe the other half doesn't exist? I leave the question open for a while ... – Thorsten Aug 05 '11 at 11:54